PHP – creating anonymous objects on the fly
April 26, 2009
1 comment
With this quick line of code it’s possible to convert arrays into anonymous objects in PHP
$obj = (object) array('foo' => 'bar', 'property' => 'value');
This is actually quiet useful when using Zend AMF to transfer objects from PHP to Flex or Flash,
without having to create classes for them.

Comments
Leave a comment Trackback