3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<? define('OBJECT_COUNT', 130000); class Object { private static $world = array(); private static $maxGuid = 0; protected $_guid = null; public function __construct() { self::$world[$this->_guid = self::$maxGuid++] = $this; } public function __destruct() { unset(self::$world[$this->_guid]); } } for ($i = 0; $i < OBJECT_COUNT; ++$i) { new Object(); } // You probably won't see this because of the "zend_mm_heap corrupted" echo 'If you see this, try to increase OBJECT_COUNT to 100,000'; ?>
Output for 5.4.20 - 5.4.45, 5.5.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
If you see this, try to increase OBJECT_COUNT to 100,000
Output for 5.5.0 - 5.5.3
If you see this, try to increase OBJECT_COUNT to 100,000zend_mm_heap corrupted
Process exited with code 1.
Output for 5.4.0 - 5.4.19
If you see this, try to increase OBJECT_COUNT to 100,000
Process exited with code 139.
Output for 4.3.0 - 5.3.29
<? define('OBJECT_COUNT', 130000); class Object { private static $world = array(); private static $maxGuid = 0; protected $_guid = null; public function __construct() { self::$world[$this->_guid = self::$maxGuid++] = $this; } public function __destruct() { unset(self::$world[$this->_guid]); } } for ($i = 0; $i < OBJECT_COUNT; ++$i) { new Object(); } // You probably won't see this because of the "zend_mm_heap corrupted" echo 'If you see this, try to increase OBJECT_COUNT to 100,000'; ?>