3v4l.org

run code in 300+ PHP versions simultaneously
<?php class my { private $a = null; protected $b = 'b'; public $c = 'c'; function __construct($b, $c) { $this->a = 'a1'; $this->b = $b; $this->c = $c; } public function test() { echo $this->a, $this->b, $this->c; } } class my_ex extends my { function __construct() { $cleaner = function () { echo "Clearing all properties", "<br>"; unset($this->a, $this->b, $this->c); }; $cleaner->bindTo($this, get_parent_class($this))->__invoke(); } function __get($name) { $lazySetter = & function($name) { echo "Lazy-loading property {$name}", "<br>"; $this->$name = "new{$name}"; return $this->$name; }; $lazySetter->bindTo($this, get_parent_class($this))->__invoke($name); } } $my = new my_ex(1,2); $my->test();

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.170.0170.04512.39
5.4.160.0130.04612.39
5.4.150.0130.05812.39
5.4.140.0150.04512.08
5.4.130.0140.04512.06
5.4.120.0160.04812.02
5.4.110.0180.05012.02
5.4.100.0150.04512.02
5.4.90.0120.04512.02
5.4.80.0150.04512.02
5.4.70.0130.04112.02
5.4.60.0130.04612.02
5.4.50.0140.04612.02
5.4.40.0150.05212.00
5.4.30.0170.05512.00
5.4.20.0130.04311.99
5.4.10.0180.05512.00
5.4.00.0120.04111.49
5.3.270.0130.04512.72
5.3.260.0130.04512.72
5.3.250.0140.03912.72
5.3.240.0150.04312.72
5.3.230.0230.06812.71
5.3.220.0170.04312.68
5.3.210.0150.04612.68
5.3.200.0140.04512.68
5.3.190.0190.06312.68
5.3.180.0190.04212.67
5.3.170.0180.05212.67
5.3.160.0160.04612.67
5.3.150.0170.05312.67
5.3.140.0160.04812.66
5.3.130.0130.04912.66
5.3.120.0140.04712.66
5.3.110.0190.05712.66
5.3.100.0140.04312.13
5.3.90.0140.04412.11
5.3.80.0160.04612.09
5.3.70.0160.04512.10
5.3.60.0190.06012.08
5.3.50.0130.04712.02
5.3.40.0200.06112.03
5.3.30.0140.04111.99
5.3.20.0120.04311.77
5.3.10.0120.04111.73
5.3.00.0140.04211.71

preferences:
134.15 ms | 1394 KiB | 7 Q