Method Not Property Name Must Be String

../_images/method_not_property_name_must_be_string.png

A dynamic property name must be a string, and it must exist. It cannot be anything else, as not casting to string happens.

On the other hand, a dynamic property name is forcefully cast to a string before accessing its value.

See Also

PHP Features