3v4l.org

run code in 300+ PHP versions simultaneously
<?php class r { protected $a = null; public function __construct($a){$this->a = $a;} public function add(){$this->a++;} public function getVal(){return $this->a;} } } class a { private function test($ref) { $ref->add(); } public function __call($f, $a) { call_user_func_array(array($this, $f), $a); } } $x = new r(10); $a = new a(); $a->test($x); echo $x->getVal();

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.6.70.4600.03020.41
5.4.390.0400.05719.24
5.4.380.0200.06018.79
5.4.370.0270.04718.61
5.4.360.0300.07018.75
5.4.350.0370.05318.57
5.4.340.0270.05018.58
5.4.320.0170.06018.80
5.4.310.0270.05718.51
5.4.300.0230.05718.75
5.4.290.0230.04718.64
5.4.280.0170.06318.75
5.4.270.0200.06018.78
5.4.260.0170.05318.58
5.4.250.0270.05018.76
5.4.240.0170.05718.57
5.4.230.0200.05718.52
5.4.220.0270.05318.82
5.4.210.0230.05018.82
5.4.200.0170.05316.61
5.4.190.0270.05018.59
5.4.180.0170.05718.75
5.4.170.0100.06018.52
5.4.160.0200.05018.72
5.4.150.0130.05718.48
5.4.140.0100.06016.20
5.4.130.0130.05316.36
5.4.120.0270.04716.24
5.4.110.0230.04316.30
5.4.100.0200.05316.46
5.4.90.0170.05316.35
5.4.80.0200.06316.36
5.4.70.0330.06016.35
5.4.60.0200.05016.23
5.4.50.0330.04016.27
5.4.40.0200.04716.23
5.4.30.0100.06016.25
5.4.20.0200.04716.28
5.4.10.0200.04316.27
5.4.00.0370.03015.70
5.3.290.0230.05014.70
5.3.280.0170.05014.76
5.3.270.0130.06014.79
5.3.260.0030.07014.79
5.3.250.0230.04714.76
5.3.240.0230.04314.71
5.3.230.0170.05314.59
5.3.220.0170.05314.67
5.3.210.0230.05014.70
5.3.200.0200.04714.56
5.3.190.0100.06014.70
5.3.180.0230.05014.79
5.3.170.0200.05314.61
5.3.160.0170.05314.61
5.3.150.0270.04014.80
5.3.140.0200.05014.54
5.3.130.0170.05314.73
5.3.120.0230.04714.77
5.3.110.0130.05714.68
5.3.100.0170.05014.08
5.3.90.0170.05014.05
5.3.80.0130.05314.24
5.3.70.0200.05014.09
5.3.60.0200.04714.17
5.3.50.0200.04713.95
5.3.40.0070.05713.93
5.3.30.0200.04314.02
5.3.20.0230.04313.72
5.3.10.0370.03313.73
5.3.00.0300.03713.75
5.2.170.0200.03311.18
5.2.160.0200.03711.37
5.2.150.0070.05311.20
5.2.140.0130.04011.35
5.2.130.0000.05311.09
5.2.120.0230.03011.32
5.2.110.0030.05011.13
5.2.100.0270.04011.14
5.2.90.0070.05011.21
5.2.80.0130.04311.21
5.2.70.0200.03711.17
5.2.60.0070.05311.15
5.2.50.0200.03711.12
5.2.40.0130.04011.20
5.2.30.0100.05010.98
5.2.20.0170.04311.14
5.2.10.0100.04310.89
5.2.00.0130.04010.83
5.1.60.0200.02710.11
5.1.50.0100.03710.04
5.1.40.0100.0509.99
5.1.30.0170.05010.39
5.1.20.0100.04010.49
5.1.10.0130.03310.11
5.1.00.0130.03710.11
5.0.50.0100.0278.63
5.0.40.0070.0278.55
5.0.30.0200.0378.27
5.0.20.0030.0378.21
5.0.10.0100.0278.20
5.0.00.0130.0378.27
4.4.90.0100.0175.90
4.4.80.0070.0206.00
4.4.70.0070.0235.87
4.4.60.0200.0105.96
4.4.50.0070.0205.97
4.4.40.0030.0405.91
4.4.30.0070.0205.91
4.4.20.0100.0175.96
4.4.10.0030.0276.03
4.4.00.0100.0305.95
4.3.110.0000.0275.94
4.3.100.0070.0235.93
4.3.90.0130.0205.80
4.3.80.0030.0375.79
4.3.70.0030.0235.81
4.3.60.0070.0205.89
4.3.50.0130.0175.84
4.3.40.0130.0275.75
4.3.30.0100.0174.84
4.3.20.0070.0234.84
4.3.10.0070.0204.84
4.3.00.0070.0177.60

preferences:
141.86 ms | 1394 KiB | 7 Q