Re: [PHP-DEV] What about a magic __toArray() method?

2020-02-04 Thread Tom Gerrits
Correct: an explicit `$foo->toArray()` call suffices. For other readers, more about `$foo->toArray()` vs `(array) $foo` is described at https://github.com/ShittySoft/symfony-live-berlin-2018-doctrine-tutorial/pull/3#issuecomment-460441229 This is a valid point. Perhaps another problem

Re: [PHP-DEV] [RFC]

2020-02-11 Thread Tom Gerrits
Hi Manuel Thanks for bringing this idea forward. Adding a non-string construct to reference functions uniquely seems like a good idea and would be consistent with the existing ::class keyword for classes. I'm wondering if it would be useful to take a page out of the book of other

Re: [PHP-DEV] [RFC] get_debug_type

2020-02-17 Thread Tom Gerrits
Hi Mark Thanks for this proposal. After the proposal by Nikita to allow ::class on object variables, would it be opportune to add ::type for any variable, with this behavior? It could behave like ::class on objects and return a string indicator of the type for other types, such as scalar