PHP 7.1.24 Released


Please answer this simple SPAM challenge: seven plus one?
(Example: nine)

The Note You're Voting On

10 years ago
For real quick and dirty one-liner anonymous objects, just cast an associative array:


= (object) array('foo' => 'bar', 'property' => 'value');

$obj->foo; // prints 'bar'
echo $obj->property; // prints 'value'


... no need to create a new class or function to accomplish it.

<< Back to user notes page

To Top