stdClass Object

PHP recycles the previously created stdClass objects ids. The following code displays Object #1, until it is stored in $b. When the stdClass is not stored in a container (variable, property, etc.), it is completely lost and no object counting happens.

Also, PHP’s stdClass’s constructor ignores all its arguments, as they are not used.

../_images/stdclass_tracking.png