3v4l.org

run code in 300+ PHP versions simultaneously
<?php class EmptyObj{ protected function __construct(){} public static function get(){ static $obj; if(!$obj) $obj = new EmptyObj; return $obj; } public function __call($n, $a){ return $this; } public __toString(){ return ''; } } class SomeClass{ public $image; public function __construct(){ $this->image = EmptyObj::get(); }} $a = new SomeClass; echo $a->image->oopsForgotToSetImage();

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.130.0150.04512.05
5.4.120.0140.04512.01
5.4.110.0150.04312.00
5.4.100.0190.05512.00
5.4.90.0230.06712.00
5.4.80.0170.04312.00
5.4.70.0140.04512.00
5.4.60.0150.04312.00
5.4.50.0150.04312.00
5.4.40.0270.06311.99
5.4.30.0190.04111.98
5.4.20.0140.04611.98
5.4.10.0180.04311.98
5.4.00.0180.03911.47
5.3.230.0170.04612.71
5.3.220.0160.04312.68
5.3.210.0170.04312.68
5.3.200.0180.04312.68
5.3.190.0160.04512.68
5.3.180.0160.04912.67
5.3.170.0160.04412.66
5.3.160.0180.04512.67
5.3.150.0190.04712.67
5.3.140.0150.04512.66
5.3.130.0160.04512.65
5.3.120.0240.07112.66
5.3.110.0130.05012.66
5.3.100.0200.05612.12
5.3.90.0260.06512.09
5.3.80.0170.04312.08
5.3.70.0150.04612.08
5.3.60.0140.04612.07
5.3.50.0150.04712.01
5.3.40.0160.04512.01
5.3.30.0250.06511.97
5.3.20.0160.04211.75
5.3.10.0160.04511.71
5.3.00.0200.06711.70

preferences:
139.73 ms | 1394 KiB | 7 Q