Reputation: 80415
What is the PHP equivalent of ECMAScript's:
var myObject={};
EDIT: I am looking to declare a PHP object.
Thank you.
Upvotes: 0
Views: 158
Reputation: 145482
That would be:
$myObject = new stdClass;
or:
$myObject = (object)NULL;
See also http://www.php.net/manual/en/language.oop5.basic.php#92123
and http://php.net/manual/en/reserved.classes.php
Upvotes: 6