3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $spec; private $msg; public function __construct($spec, $msg = null) { $this->spec = $spec; $this->msg = $msg; } public static function new_instance($spec, $msg = null) { return new static($spec, $msg); } } const ITERATIONS = 1000000; $time1 = -microtime(true); for ($i = 0; $i < ITERATIONS; ++$i) { Foo::new_instance([], 'foo'); } $time1 += microtime(true); echo "direct function call took $time1 seconds\n"; $time2 = -microtime(true); for ($i = 0; $i < ITERATIONS; ++$i) { call_user_func_array(['Foo', 'new_instance'], [[], 'foo']); } $time2 += microtime(true); echo "call_user_func_array() took $time2 seconds\n"; echo "difference: ", $time2 / $time1, "\n";

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)
7.3.10.0050.54116.79
7.3.00.0030.50916.62
7.2.130.0100.58916.98
7.2.120.0080.58716.86
7.2.110.0050.57717.08
7.2.100.0070.56716.80
7.2.90.0100.56516.85
7.2.80.0050.59216.74
7.2.70.0030.58416.97
7.2.60.0080.57016.84
7.2.50.0100.54716.77
7.2.40.0120.54017.07
7.2.30.0120.55117.02
7.2.20.0050.53217.00
7.2.10.0100.55416.82
7.2.00.0060.50917.84
7.1.250.0030.81415.76
7.1.70.0000.42916.93
7.1.60.0070.41519.82
7.1.50.0070.42917.04
7.1.00.0030.37722.36
7.0.200.0000.58716.80
7.0.140.0070.52321.92
7.0.100.0100.38020.04
7.0.90.0030.51320.07
7.0.80.0230.53019.93
7.0.70.0070.39719.91
7.0.60.0330.53320.06
7.0.50.0030.53720.19
7.0.40.0070.55720.11
7.0.30.0070.52320.05
7.0.20.0070.51720.08
7.0.10.0100.47720.04
7.0.00.0000.46019.99
5.6.280.0071.45720.93
5.6.250.0001.21720.76
5.6.240.0101.30720.58
5.6.230.0131.33720.60
5.6.220.0101.39320.59
5.6.210.0071.30720.65
5.6.200.0001.26021.09
5.6.190.0001.27721.05
5.6.180.0131.34021.04
5.6.170.0101.21721.14
5.6.160.0101.32721.18
5.6.150.0071.23021.11
5.6.140.0131.13321.09
5.6.130.0071.27321.02
5.6.120.0101.29021.05
5.6.110.0071.34021.03
5.6.100.0071.19721.13
5.6.90.0131.29020.91
5.6.80.0001.29720.43
5.6.70.0031.26320.43
5.6.60.0101.28720.44
5.6.50.0131.36320.41
5.6.40.0131.32020.38
5.6.30.0001.47720.45
5.6.20.0031.23720.29
5.6.10.1201.30320.41
5.6.00.0071.36320.36
5.5.380.0101.31720.41
5.5.370.0071.30720.50
5.5.360.0101.30320.45
5.5.350.0071.48320.36
5.5.340.0031.22720.74
5.5.330.0101.42020.81
5.5.320.0131.37320.91
5.5.310.0071.31020.80
5.5.300.0071.36320.65
5.5.290.0071.36320.82
5.5.280.0101.20020.83
5.5.270.0031.30020.79
5.5.260.0071.42020.92
5.5.250.0071.28020.70
5.5.240.0101.13020.17
5.5.230.0101.26020.27
5.5.220.0101.19020.14
5.5.210.0001.41720.29
5.5.200.0101.39720.27
5.5.190.0101.32020.27
5.5.180.0101.31319.97
5.5.160.0031.14320.14
5.5.150.0071.26320.15
5.5.140.0101.31720.13
5.5.130.0071.22320.22
5.5.120.0071.32320.27
5.5.110.0071.32020.21
5.5.100.0071.41020.13
5.5.90.0001.15020.08
5.5.80.0101.29719.95
5.5.70.0001.30020.09
5.5.60.0071.33320.11
5.5.50.0101.21320.13
5.5.40.0001.30719.97
5.5.30.0131.25320.10
5.5.20.0001.32020.09
5.5.10.0001.40320.11
5.5.00.0071.24719.93
5.4.450.0031.31719.27
5.4.440.0131.53719.33
5.4.430.0001.21319.26
5.4.420.0031.18719.48
5.4.410.0071.33719.04
5.4.400.0001.28719.04
5.4.390.0071.35019.13
5.4.380.0201.33019.08
5.4.370.0131.32019.00
5.4.360.0071.27319.12
5.4.350.0031.30318.85
5.4.340.0101.34718.90
5.4.320.0201.21318.94
5.4.310.0031.38718.87
5.4.300.0071.13019.20
5.4.290.0101.29319.16
5.4.280.0001.18319.04
5.4.270.0001.29719.15
5.4.260.0031.17018.87
5.4.250.0001.35019.04
5.4.240.0001.11719.12
5.4.230.0001.40719.17
5.4.220.0101.10319.11
5.4.210.0001.39319.04
5.4.200.0031.33319.09
5.4.190.0071.15019.11
5.4.180.0031.26018.84
5.4.170.0071.34319.11
5.4.160.0071.31019.00
5.4.150.0031.18318.88
5.4.140.0031.33316.25
5.4.130.0031.12316.42
5.4.120.0101.29716.45
5.4.110.0031.24316.39
5.4.100.0071.38716.52
5.4.90.0001.44016.33
5.4.80.0031.29316.46
5.4.70.0131.32016.49
5.4.60.0101.29316.41
5.4.50.0071.35716.46
5.4.40.0071.28316.30
5.4.30.0071.28016.29
5.4.20.0031.25316.41
5.4.10.0031.18316.44
5.4.00.0071.40315.69
5.3.290.0130.07314.60
5.3.280.0100.05014.63
5.3.270.0030.05014.67
5.3.260.0030.03714.60
5.3.250.0100.02714.72
5.3.240.0030.07014.55
5.3.230.0030.06014.66
5.3.220.0030.07014.53
5.3.210.0100.07314.70
5.3.200.0000.08314.55
5.3.190.0000.06014.55
5.3.180.0030.03714.58
5.3.170.0070.05014.66
5.3.160.0100.06714.56
5.3.150.0100.07014.52
5.3.140.0030.07714.48
5.3.130.0070.06014.48
5.3.120.0070.05714.57
5.3.110.0070.06714.54
5.3.100.0170.03014.01
5.3.90.0070.07013.95
5.3.80.0070.03714.09
5.3.70.0070.07314.05
5.3.60.0000.04014.09
5.3.50.0130.06314.07
5.3.40.0170.06014.02
5.3.30.0100.03013.84
5.3.20.0070.07013.60
5.3.10.0100.06713.65
5.3.00.0000.07313.66
5.2.170.0030.05012.32
5.2.160.0000.04012.32
5.2.150.0000.05712.32
5.2.140.0000.06712.32
5.2.130.0130.05012.32
5.2.120.0070.04312.32
5.2.110.0130.05012.32
5.2.100.0100.02012.32
5.2.90.0100.05312.32
5.2.80.0000.03712.32
5.2.70.0030.03012.32
5.2.60.0100.04712.32
5.2.50.0030.03012.32
5.2.40.0030.03012.32
5.2.30.0000.03312.32
5.2.20.0000.03012.32
5.2.10.0100.05312.32
5.2.00.0100.04012.32
5.1.60.0070.05312.32
5.1.50.0030.05712.32
5.1.40.0030.05312.32
5.1.30.0070.03012.32
5.1.20.0000.05712.32
5.1.10.0070.04312.32
5.1.00.0030.06012.32
5.0.50.0030.04012.32
5.0.40.0030.02312.32
5.0.30.0000.04312.32
5.0.20.0000.02312.32
5.0.10.0030.04712.32
5.0.00.0070.04312.32
4.4.90.0000.01712.32
4.4.80.0000.01712.32
4.4.70.0000.02012.32
4.4.60.0030.01712.32
4.4.50.0000.02012.32
4.4.40.0030.05312.32
4.4.30.0030.03312.32
4.4.20.0070.03312.32
4.4.10.0000.03712.32
4.4.00.0030.02312.32
4.3.110.0000.02312.32
4.3.100.0030.01712.32
4.3.90.0030.01312.32
4.3.80.0030.04012.32
4.3.70.0130.01012.32
4.3.60.0000.02012.32
4.3.50.0000.01712.32
4.3.40.0000.02312.32
4.3.30.0030.02712.32
4.3.20.0000.01712.32
4.3.10.0000.01712.32
4.3.00.0000.01712.32

preferences:
32.28 ms | 401 KiB | 5 Q