Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Derick Rethans' Blog:
var_export and classes
Oct 18, 2005 @ 10:21:34

On his blog this morning, Derick Rethans has a new post with a look at an issue resurfacing with var_export and claseses.

Today I stumbled upon an old problem while using var_export() on an array with objects. var_exports()'s description is "Outputs or returns a parsable string representation of a variable", but it didn't work to well in this case.

He fixes the issue (of the var_dump output) with a tip involving the __set_state() method, making it possible to display a correct class inside an object...

tagged:

Link:


Trending Topics: