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 = 100000; $time1 = -microtime(true); for ($i = 0; $i < ITERATIONS; ++$i) { Foo::new_instance(array(), '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(array('Foo', 'new_instance'), array(array(), '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.4.10.0030.09315.11
7.4.00.0100.08714.80
7.3.130.0030.07114.71
7.3.120.0100.07115.01
7.3.110.0080.07614.82
7.3.100.0020.06214.61
7.3.90.0020.05815.00
7.3.80.0030.05215.08
7.3.70.0050.05914.74
7.3.60.0020.05514.86
7.3.50.0020.05814.83
7.3.40.0050.05114.86
7.3.30.0050.05214.72
7.3.20.0070.05616.79
7.3.10.0050.05716.59
7.3.00.0050.05616.48
7.2.260.0100.09315.13
7.2.250.0050.08414.98
7.2.240.0050.07615.08
7.2.230.0030.06415.01
7.2.220.0080.06815.14
7.2.210.0030.06715.00
7.2.200.0030.06015.22
7.2.190.0110.05514.99
7.2.180.0030.05715.18
7.2.170.0030.06815.07
7.2.160.0070.06215.22
7.2.150.0030.06216.88
7.2.140.0070.05716.90
7.2.130.0030.06716.96
7.2.120.0030.06416.87
7.2.110.0070.05316.74
7.2.100.0100.05616.80
7.2.90.0130.06216.78
7.2.80.0150.05416.78
7.2.70.0110.05516.99
7.2.60.0080.05717.08
7.2.50.0100.05916.87
7.2.40.0080.05717.05
7.2.30.0080.05816.96
7.2.20.0050.05616.80
7.2.10.0130.05616.95
7.2.00.0080.05517.06
7.1.330.0100.09315.84
7.1.320.0070.09115.87
7.1.310.0020.09015.73
7.1.300.0050.08415.81
7.1.290.0070.08315.74
7.1.280.0050.08816.00
7.1.270.0020.08515.85
7.1.260.0020.08315.74
7.1.250.0030.08615.87
7.1.240.0050.08315.66
7.1.230.0040.07715.74
7.1.220.0200.07315.82
7.1.210.0100.07215.82
7.1.200.0090.07415.78
7.1.190.0090.07215.79
7.1.180.0120.07215.91
7.1.170.0070.07115.82
7.1.160.0100.07015.83
7.1.150.0020.09515.82
7.1.140.0100.06515.77
7.1.130.0110.07015.79
7.1.120.0070.07015.75
7.1.110.0120.07615.79
7.1.100.0080.08615.80
7.1.90.0110.07015.81
7.1.80.0040.07915.79
7.1.70.0070.06416.22
7.1.60.0090.06516.79
7.1.50.0120.08116.06
7.1.40.0050.07815.77
7.1.30.0080.07215.79
7.1.20.0060.07615.81
7.1.10.0070.07915.83
7.1.00.0050.07417.46
7.0.330.0070.09315.37
7.0.320.0030.08915.39
7.0.310.0040.08215.34
7.0.300.0090.07715.38
7.0.290.0080.07715.26
7.0.280.0050.09215.34
7.0.270.0070.08415.45
7.0.260.0070.07715.31
7.0.250.0100.09015.40
7.0.240.0140.07615.42
7.0.230.0090.08315.47
7.0.220.0230.08915.46
7.0.210.0060.07815.49
7.0.200.0070.08115.74
7.0.190.0130.08715.56
7.0.180.0050.08415.29
7.0.170.0070.07915.41
7.0.160.0140.08315.42
7.0.150.0080.07815.51
7.0.140.0060.10017.04
7.0.130.0070.07515.46
7.0.120.0040.08215.44
7.0.110.0050.09716.46
7.0.100.0090.09716.42
7.0.90.0060.09616.60
7.0.80.0080.09116.50
7.0.70.0100.09616.55
7.0.60.0060.09216.60
7.0.50.0050.09516.63
7.0.40.0060.09815.22
7.0.30.0080.09415.17
7.0.20.0050.10115.13
7.0.10.0080.09215.14
7.0.00.0090.09815.11
5.6.400.0030.24614.28
5.6.390.0100.24914.45
5.6.380.0090.22714.44
5.6.370.0040.20914.36
5.6.360.0080.21614.55
5.6.350.0110.23414.40
5.6.340.0070.22614.14
5.6.330.0080.21814.45
5.6.320.0080.20614.57
5.6.310.0050.21714.26
5.6.300.0080.22414.47
5.6.290.0110.21014.50
5.6.280.0070.22916.11
5.6.270.0060.21714.42
5.6.260.0060.21416.01
5.6.250.0070.20216.01
5.6.240.0090.22915.89
5.6.230.0070.22815.91
5.6.220.0080.20815.94
5.6.210.0070.22115.96
5.6.200.0070.22416.02
5.6.190.0060.21116.02
5.6.180.0090.22215.94
5.6.170.0030.23116.07
5.6.160.0090.22315.86
5.6.150.0070.22115.90
5.6.140.0080.22515.99
5.6.130.0090.21215.95
5.6.120.0090.21815.96
5.6.110.0070.22115.90
5.6.100.0060.23216.00
5.6.90.0070.24816.14
5.6.80.0040.21415.74
5.6.70.0080.22015.72
5.6.60.0090.21315.74
5.6.50.0080.21415.84
5.6.40.0070.21915.67
5.6.30.0070.23215.67
5.6.20.0090.20815.68
5.6.10.0120.21815.72
5.6.00.0050.22015.78
5.5.380.0020.22514.77
5.5.370.0070.21514.82
5.5.360.0080.20614.76
5.5.350.0060.23014.86
5.5.340.0040.21114.96
5.5.330.0060.20815.00
5.5.320.0030.22614.86
5.5.310.0030.22114.83
5.5.300.0060.20614.96
5.5.290.0030.22714.92
5.5.280.0070.21014.83
5.5.270.0040.21714.96
5.5.260.0070.23814.97
5.5.250.0080.21314.81
5.5.240.0070.21914.72
5.5.230.0080.20114.75
5.5.220.0050.21914.71
5.5.210.0060.21214.65
5.5.200.0070.21514.74
5.5.190.0060.22714.74
5.5.180.0120.23614.69
5.5.170.0040.22314.39
5.5.160.0090.22614.73
5.5.150.0040.21614.80
5.5.140.0080.20814.67
5.5.130.0040.23114.68
5.5.120.0040.21314.80
5.5.110.0050.23214.66
5.5.100.0090.22214.79
5.5.90.0070.24614.58
5.5.80.0070.20014.58
5.5.70.0080.21914.61
5.5.60.0040.19814.50
5.5.50.0060.22614.67
5.5.40.0090.22314.73
5.5.30.0060.20614.66
5.5.20.0060.20114.62
5.5.10.0060.21714.61
5.5.00.0050.21314.55
5.4.450.0030.23314.28
5.4.440.0050.23514.37
5.4.430.0020.21114.41
5.4.420.0030.24514.36
5.4.410.0050.22614.31
5.4.400.0020.22514.25
5.4.390.0070.20314.25
5.4.380.0050.21014.23
5.4.370.0070.20314.24
5.4.360.0050.21014.25
5.4.350.0020.23314.30
5.4.340.0060.22914.29
5.4.330.0050.21412.69
5.4.320.0030.24314.17
5.4.310.0050.21614.26
5.4.300.0060.21114.17
5.4.290.0020.20914.24
5.4.280.0050.21614.26
5.4.270.0030.23614.30
5.4.260.0050.20414.21
5.4.250.0060.22614.23
5.4.240.0050.24714.21
5.4.230.0030.20614.30
5.4.220.0020.21214.18
5.4.210.0070.22614.21
5.4.200.0050.22414.23
5.4.190.0070.21414.20
5.4.180.0050.21314.19
5.4.170.0030.21414.22
5.4.160.0060.20914.23
5.4.150.0050.20314.16
5.4.140.0070.19713.63
5.4.130.0030.22713.62
5.4.120.0090.22213.61
5.4.110.0030.20913.50
5.4.100.0040.20913.53
5.4.90.0070.22213.60
5.4.80.0060.23513.63
5.4.70.0050.20413.58
5.4.60.0040.22913.63
5.4.50.0040.22713.60
5.4.40.0070.22913.64
5.4.30.0080.24013.55
5.4.20.0070.23613.60
5.4.10.0080.22913.58
5.4.00.0030.23013.33
5.3.290.0050.32513.04
5.3.280.0040.29612.98
5.3.270.0040.28513.03
5.3.260.0020.31112.99
5.3.250.0020.30612.91
5.3.240.0040.31512.92
5.3.230.0060.33312.98
5.3.220.0020.27812.98
5.3.210.0020.32612.90
5.3.200.0030.30312.87
5.3.190.0060.29712.96
5.3.180.0090.30712.99
5.3.170.0040.31612.98
5.3.160.0040.29413.00
5.3.150.0040.32812.94
5.3.140.0060.31512.96
5.3.130.0030.29512.97
5.3.120.0060.31412.97
5.3.110.0040.30612.97
5.3.100.0060.33312.85
5.3.90.0050.31512.85
5.3.80.0030.32312.83
5.3.70.0040.32012.80
5.3.60.0070.32912.82
5.3.50.0060.32112.78
5.3.40.0070.31912.85
5.3.30.0070.31212.86
5.3.20.0040.30012.69
5.3.10.0040.31012.70
5.3.00.0080.28012.67
5.2.170.0050.03411.97
5.2.160.0100.03012.04
5.2.150.0070.03212.03
5.2.140.0060.03012.01
5.2.130.0070.03211.99
5.2.120.0040.03512.02
5.2.110.0060.03212.02
5.2.100.0090.03211.96
5.2.90.0060.03411.98
5.2.80.0030.03511.95
5.2.70.0030.03311.99
5.2.60.0110.03211.92
5.2.50.0090.03012.02
5.2.40.0030.03311.89
5.2.30.0040.03211.90
5.2.20.0100.03011.95
5.2.10.0090.03011.83
5.2.00.0040.03211.87
5.1.60.0050.03011.38
5.1.50.0090.01511.38
5.1.40.0060.02511.38
5.1.30.0060.02011.57
5.1.20.0030.03311.62
5.1.10.0070.02911.47
5.1.00.0060.03111.43
5.0.50.0030.02311.36
5.0.40.0040.02311.36
5.0.30.0040.03511.36
5.0.20.0040.02511.36
5.0.10.0020.02411.36
5.0.00.0030.03211.36
4.4.90.0000.01811.36
4.4.80.0010.01911.36
4.4.70.0080.01511.36
4.4.60.0020.01911.36
4.4.50.0050.01711.36
4.4.40.0020.02811.36
4.4.30.0000.01911.36
4.4.20.0030.01911.36
4.4.10.0060.01511.36
4.4.00.0000.02611.36
4.3.110.0030.01811.36
4.3.100.0010.01911.36
4.3.90.0000.02111.36
4.3.80.0030.02711.36
4.3.70.0040.01711.36
4.3.60.0030.01811.36
4.3.50.0030.01311.36
4.3.40.0040.01811.36
4.3.30.0000.01911.36
4.3.20.0000.01411.36
4.3.10.0050.01711.36
4.3.00.0040.01711.36

preferences:
42.29 ms | 401 KiB | 5 Q