3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function foo($param) { // do some special logic // and return either true or false return true; } } class B { function bar($var, $func) { $method = $func[0] . '::' . $func[1]; foreach($var as $v) { if(call_user_func($method, $v)) { echo 'OK'; } } } } class Start { function init() { $b = new B(); $test = array(1,2,3,4,5); $b->bar($test, ['A', 'foo']); } } Start::init();

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)
8.3.60.0140.00716.61
8.3.50.0140.00621.20
8.3.40.0070.00718.84
8.3.30.0110.00318.84
8.3.20.0040.00418.77
8.3.10.0080.00019.82
8.3.00.0050.00319.08
8.2.180.0030.01318.16
8.2.170.0090.00622.96
8.2.160.0080.00619.33
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0050.00320.91
8.2.120.0070.00026.35
8.2.110.0030.00622.22
8.2.100.0060.00617.78
8.2.90.0060.00319.13
8.2.80.0050.00317.97
8.2.70.0080.00017.50
8.2.60.0080.00017.93
8.2.50.0060.00318.10
8.2.40.0050.00220.25
8.2.30.0000.00820.55
8.2.20.0040.00417.74
8.2.10.0000.00718.04
8.2.00.0000.00918.04
8.1.280.0030.01725.92
8.1.270.0080.00023.92
8.1.260.0080.00028.09
8.1.250.0050.00328.09
8.1.240.0040.00422.14
8.1.230.0110.00519.14
8.1.220.0080.00017.74
8.1.210.0050.00518.77
8.1.200.0060.00317.22
8.1.190.0040.00417.23
8.1.180.0030.00518.10
8.1.170.0000.00818.46
8.1.160.0000.00718.95
8.1.150.0000.00818.75
8.1.140.0000.00819.39
8.1.130.0040.00417.59
8.1.120.0000.00717.19
8.1.110.0030.00517.40
8.1.100.0000.00717.29
8.1.90.0060.00317.23
8.1.80.0000.00817.32
8.1.70.0050.00317.18
8.1.60.0070.00317.40
8.1.50.0050.00317.41
8.1.40.0000.01017.42
8.1.30.0090.00017.56
8.1.20.0080.00017.52
8.1.10.0050.00317.38
8.1.00.0000.00817.33
8.0.300.0070.00018.77
8.0.290.0030.00616.75
8.0.280.0040.00418.38
8.0.270.0070.00016.86
8.0.260.0060.00017.11
8.0.250.0000.00716.83
8.0.240.0030.00516.98
8.0.230.0070.00016.96
8.0.220.0040.00316.89
8.0.210.0040.00416.92
8.0.200.0030.00316.98
8.0.190.0070.00016.95
8.0.180.0050.00316.88
8.0.170.0040.00416.82
8.0.160.0040.00416.89
8.0.150.0050.00216.75
8.0.140.0100.00016.73
8.0.130.0030.00313.26
8.0.120.0040.00416.91
8.0.110.0040.00416.82
8.0.100.0040.00416.77
8.0.90.0040.00416.98
8.0.80.0040.01116.88
8.0.70.0000.00816.84
8.0.60.0000.00716.75
8.0.50.0000.00716.75
8.0.30.0110.00817.08
8.0.20.0120.00917.40
8.0.10.0040.00416.92
8.0.00.0070.01216.75
7.4.330.0000.00515.08
7.4.320.0000.00616.52
7.4.300.0030.00316.62
7.4.290.0000.00816.50
7.4.280.0070.00016.61
7.4.270.0030.00316.61
7.4.260.0030.00316.59
7.4.250.0080.00016.47
7.4.240.0030.00316.59
7.4.230.0070.00016.67
7.4.220.0060.01316.56
7.4.210.0060.00916.61
7.4.200.0040.00416.50
7.4.160.0080.00816.75
7.4.150.0140.00317.40
7.4.140.0130.01017.86
7.4.130.0110.00716.50
7.4.120.0070.01416.71
7.4.110.0120.00616.59
7.4.100.0100.00716.54
7.4.90.0060.01216.66
7.4.80.0150.00319.39
7.4.70.0090.00916.52
7.4.60.0070.01516.41
7.4.50.0070.01116.57
7.4.40.0110.00716.58
7.4.30.0040.01216.59
7.4.10.0100.01015.07
7.4.00.0030.01514.86
7.3.330.0030.00313.45
7.3.320.0050.00013.39
7.3.310.0000.00716.27
7.3.300.0030.00316.29
7.3.290.0030.00316.37
7.3.280.0080.01016.36
7.3.270.0120.00617.40
7.3.260.0080.00816.70
7.3.250.0060.01216.53
7.3.240.0050.01416.62
7.3.230.0120.00316.53
7.3.210.0030.01416.57
7.3.200.0170.00016.34
7.3.190.0070.01016.45
7.3.180.0120.00316.45
7.3.170.0180.00516.48
7.3.160.0160.00716.53
7.3.130.0070.00715.01
7.3.120.0100.00714.98
7.3.110.0100.00715.04
7.3.100.0000.01614.86
7.3.90.0080.00814.79
7.3.80.0120.00514.90
7.3.70.0080.00814.60
7.3.60.0130.00314.63
7.3.50.0080.00714.94
7.3.40.0120.00814.90
7.3.30.0050.01014.80
7.3.20.0140.00515.86
7.3.10.0110.00915.89
7.3.00.0050.01215.74
7.2.330.0170.00016.74
7.2.320.0180.01316.69
7.2.310.0130.01016.67
7.2.300.0100.00716.43
7.2.290.0090.00616.79
7.2.260.0040.01515.02
7.2.250.0120.00315.04
7.2.240.0060.00915.27
7.2.230.0090.00615.04
7.2.220.0060.00915.04
7.2.210.0090.01114.89
7.2.200.0060.01014.87
7.2.190.0110.00614.95
7.2.180.0050.01215.07
7.2.170.0130.00515.11
7.2.160.0120.00414.99
7.2.150.0090.01116.11
7.2.140.0100.01015.83
7.2.130.0070.01215.93
7.2.120.0340.00715.84
7.2.110.0090.01316.03
7.2.100.0130.00616.01
7.2.90.0130.00816.17
7.2.80.0090.01015.95
7.2.70.0150.00715.88
7.2.60.0070.01016.20
7.2.50.0150.00515.82
7.2.40.0100.00715.96
7.2.30.0130.00716.00
7.2.20.0160.00516.07
7.2.10.0140.00715.99
7.2.00.0110.00417.10
7.1.330.0090.00315.47
7.1.320.0100.00616.00
7.1.310.0100.00814.99
7.1.300.0130.00614.89
7.1.290.0140.00514.73
7.1.280.0170.00414.65
7.1.270.0090.00814.90
7.1.260.0130.00514.88
7.1.250.0130.00714.73
7.1.240.0090.01014.79
7.1.230.0120.00614.87
7.1.220.0100.00814.65
7.1.210.0100.00714.74
7.1.200.0080.00615.18
7.1.190.0090.00614.87
7.1.180.0140.00714.84
7.1.170.0110.00814.93
7.1.160.0130.00714.90
7.1.150.0140.00614.84
7.1.140.0130.00714.92
7.1.130.0140.00514.85
7.1.120.0210.00514.85
7.1.110.0080.01014.92
7.1.100.0180.01215.28
7.1.90.0130.00514.90
7.1.80.0100.00814.99
7.1.70.0070.01215.60
7.1.60.0090.01016.73
7.1.50.0070.00815.52
7.1.40.0090.00915.03
7.1.30.0140.00714.88
7.1.20.0110.00914.91
7.1.10.0080.01114.75
7.1.00.0080.02817.43
7.0.330.0130.01113.61
7.0.320.0200.00013.31
7.0.310.0180.00713.56
7.0.300.0170.00513.76
7.0.290.0140.00713.61
7.0.280.0130.00913.81
7.0.270.0200.00313.73
7.0.260.0180.00613.47
7.0.250.0200.00713.70
7.0.240.0130.01313.48
7.0.230.0220.00013.30
7.0.220.0180.00413.63
7.0.210.0210.00313.59
7.0.200.0110.01015.02
7.0.190.0190.00313.55
7.0.180.0120.01213.47
7.0.170.0140.01113.76
7.0.160.0130.00913.68
7.0.150.0190.00413.50
7.0.140.0160.00813.55
7.0.130.0000.01813.61
7.0.120.0190.00313.58
7.0.110.0120.00513.49
7.0.100.0170.00713.48
7.0.90.0150.00813.64
7.0.80.0160.00813.85
7.0.70.0130.01013.63
7.0.60.0160.03317.72
7.0.50.0110.02315.74
7.0.40.0280.02816.82
7.0.30.0330.03317.05
7.0.20.0220.03216.98
7.0.10.0210.03816.92
7.0.00.0130.03516.88
5.6.400.0140.00514.17
5.6.390.0100.00714.56
5.6.380.0130.01014.22
5.6.370.0110.01114.50
5.6.360.0160.00614.61
5.6.350.0220.00314.32
5.6.340.0070.01314.22
5.6.330.0170.00514.63
5.6.320.0170.00214.41
5.6.310.0160.00513.80
5.6.300.0130.00314.34
5.6.290.0120.01314.57
5.6.280.0080.04417.66
5.6.270.0160.00014.50
5.6.260.0080.00814.50
5.6.250.0100.01014.25
5.6.240.0070.01514.45
5.6.230.0210.00314.50
5.6.220.0110.01214.52
5.6.210.0110.03817.50
5.6.200.0110.04316.25
5.6.190.0280.03417.74
5.6.180.0260.04017.67
5.6.170.0160.03617.74
5.6.160.0130.03517.73
5.6.150.0200.03017.72
5.6.140.0160.03417.61
5.6.130.0200.02817.76
5.6.120.0190.03817.76
5.6.110.0240.03617.72
5.6.100.0300.03517.67
5.6.90.0310.03017.91
5.6.80.0250.03017.42
5.6.70.0210.03417.31
5.6.60.0220.03317.54
5.6.50.0230.02817.34
5.6.40.0230.03317.39
5.6.30.0280.04017.28
5.6.20.0280.02917.39
5.6.10.0200.03217.23
5.6.00.0240.02517.45
5.5.380.0110.00514.35
5.5.370.0150.00914.31
5.5.360.0140.00914.29
5.5.350.0110.02117.18
5.5.340.0060.03316.24
5.5.330.0190.03817.77
5.5.320.0230.04317.70
5.5.310.0260.03317.48
5.5.300.0240.04217.58
5.5.290.0140.03417.64
5.5.280.0130.04217.67
5.5.270.0260.03017.66
5.5.260.0220.03417.56
5.5.250.0310.02817.50
5.5.240.0190.03217.15
5.5.230.0230.03517.13
5.5.220.0190.03817.04
5.5.210.0230.03017.40
5.5.200.0260.02617.20
5.5.190.0250.03417.29
5.5.180.0250.04017.26
5.5.170.0170.00414.11
5.5.160.0260.02617.23
5.5.150.0200.03317.24
5.5.140.0320.02717.29
5.5.130.0190.03217.30
5.5.120.0200.02817.39
5.5.110.0200.03217.29
5.5.100.0220.03217.27
5.5.90.0270.02717.26
5.5.80.0270.02917.18
5.5.70.0080.03417.09
5.5.60.0080.03617.23
5.5.50.0210.02517.04
5.5.40.0240.02617.15
5.5.30.0230.03817.00
5.5.20.0240.03117.25
5.5.10.0190.03417.21
5.5.00.0200.03317.17

preferences:
33.27 ms | 401 KiB | 5 Q