stdClass Object

no-email (Damien Seguy), Damien Seguy
Tue, 09 Aug 2022 00:00:00 +0000

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.