note 48950 deleted from language.oop5.basic by colder
| From: | colder@php.net | Date: | Sun, 19 Aug 2007 23:39:53 +0000 |
| Subject: | note 48950 deleted from language.oop5.basic by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-129607@lists.php.net to get a copy of this message | ||
Note Submitter: jerry
----
If you instantiate a class and assign it to a variable over and over again, php will start saving
instances #1 and #2 in memory but will stop at these, and will not save more than those
instances(ie. #3, #4, #5, #6...). Instead it will toggle between #1 and #2.
<?php
$obj1 = new stdclass();
var_dump($obj1);
$obj1 = new stdclass();
var_dump($obj1);
$obj1 = new stdclass();
var_dump($obj1);
$obj1 = new stdclass();
var_dump($obj1);
$obj1 = new stdclass();
var_dump($obj1);
$obj1 = new stdclass();
var_dump($obj1);
$obj1 = new stdclass();
var_dump($obj1);
?>