3v4l.org

run code in 300+ PHP versions simultaneously
<?php $iterations = 100000; $container = new ArrayObject(array()); class A { protected $number; public function __construct() { $this->number = mt_rand(1, 10000); } } for ($i = 0; $i <= $iterations; ++$i) { $someVariable = new A; $container[] = $someVariable; }

preferences:
33.84 ms | 402 KiB | 5 Q