PHP – creating anonymous objects on the fly
April 26, 2009
4 comments
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 quite 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