> Maybe I’m missing the point (I’ve never used it) of VarDumper, but isn’t this 
> type of thing exactly why the `__debugInfo` magic method exists?


I can't speak for the exact reason a library like VarDumper is using casting 
versus __debugInfo, but in trying to find a substitute this morning, I played 
with the method you mentioned and found that it can be overwritten by classes 
and be commanded to not return anything (similar to my __toArray proposal), 
whereas current functionality prevents overriding casting to an array so 
casting will always give you insight but users can overwrite __debugInfo and 
cause unintended effects. I assume that's the reason for not using __debugInfo.

--
Steven Wade
stevenwad...@gmail.com




--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to