Cast Are Case Insensitive

../_images/cast_are_case_insensitive.png

Today I learned that PHP cast operators like (int) and (array) are case-insensitive—so (STRING) works just as well. Additionally, the amount of whitespace (spaces, tabs, etc.) around these casts doesn’t affect functionality. These aspects are flexible in PHP, and what remains—such as casing and spacing style—is largely a matter of coding convention and personal or team preference.

See Also

PHP Features