3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public static function bar(array $ids) { return array_map(function($id) { return static::foo($id); }, $ids); } public static function foo($id) { return "halo {$id}"; } } class Test1 extends Test { public static function foo($id) { return "hi {$id}"; } } $className = Test1::class; //Let's say line above is input from user or some other code. $ids = [1, 2, 3, 4, 5]; print_r(call_user_func([$className, 'bar'], $ids));

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.5.10.0080.00920.11
8.5.00.0120.01319.92
8.4.150.0030.00014.05
8.4.140.0140.00717.55
8.4.130.0100.01017.84
8.4.120.0090.01020.50
8.4.110.0110.00922.45
8.4.100.0110.00917.55
8.4.90.0160.00517.57
8.4.80.0120.00917.70
8.4.70.0130.00717.71
8.4.60.0130.00817.93
8.4.50.0150.00517.79
8.4.40.0100.01018.43
8.4.30.0090.00917.63
8.4.20.0100.01017.44
8.4.10.0070.00317.79
8.3.280.0120.01018.29
8.3.270.0110.00816.57
8.3.260.0110.00916.51
8.3.250.0040.00518.72
8.3.240.0090.01016.73
8.3.230.0140.00516.40
8.3.220.0090.01016.29
8.3.210.0110.00816.55
8.3.200.0100.00516.64
8.3.190.0120.00716.49
8.3.180.0060.00218.25
8.3.170.0130.00616.43
8.3.160.0090.00916.73
8.3.150.0110.00417.04
8.3.140.0080.00816.47
8.3.130.0050.00316.47
8.3.120.0030.00618.89
8.3.110.0100.00720.94
8.3.100.0060.01224.06
8.3.90.0050.00326.77
8.3.80.0100.00018.55
8.3.70.0090.00618.38
8.3.60.0120.00616.50
8.3.50.0080.01222.05
8.3.40.0070.00718.80
8.3.30.0120.00318.57
8.3.20.0040.00420.39
8.3.10.0000.00823.71
8.3.00.0030.00519.79
8.2.290.0100.00920.44
8.2.280.0110.00918.41
8.2.270.0120.00417.11
8.2.260.0140.00320.55
8.2.250.0050.00316.66
8.2.240.0120.00317.30
8.2.230.0150.00022.58
8.2.220.0040.00437.54
8.2.210.0060.00926.77
8.2.200.0070.00418.41
8.2.190.0090.00616.58
8.2.180.0140.00716.63
8.2.170.0180.00422.96
8.2.160.0070.00720.43
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00420.90
8.2.120.0050.00326.35
8.2.110.0060.00319.39
8.2.100.0080.00417.97
8.2.90.0040.00419.30
8.2.80.0000.00817.97
8.2.70.0000.00917.50
8.2.60.0030.00618.05
8.2.50.0040.00418.07
8.2.40.0030.00719.95
8.2.30.0080.00017.98
8.2.20.0040.00417.59
8.2.10.0080.00017.99
8.2.00.0070.00017.99
8.1.330.0120.00720.35
8.1.320.0120.00716.08
8.1.310.0050.00318.57
8.1.300.0120.00619.73
8.1.290.0040.00418.88
8.1.280.0110.00425.92
8.1.270.0040.00418.91
8.1.260.0030.00728.09
8.1.250.0080.00028.09
8.1.240.0100.00023.82
8.1.230.0110.00017.70
8.1.220.0000.01017.75
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0050.00317.25
8.1.180.0030.00618.10
8.1.170.0040.00418.51
8.1.160.0040.00718.90
8.1.150.0070.00018.91
8.1.140.0060.00319.45
8.1.130.0070.00017.57
8.1.120.0000.00717.42
8.1.110.0000.00717.35
8.1.100.0000.00717.45
8.1.90.0040.00417.49
8.1.80.0070.00017.43
8.1.70.0000.00717.43
8.1.60.0000.00917.46
8.1.50.0030.00517.57
8.1.40.0000.01017.56
8.1.30.0050.00317.60
8.1.20.0030.00517.54
8.1.10.0040.00417.60
8.1.00.0000.00717.48
8.0.300.0070.00018.77
8.0.290.0050.00316.63
8.0.280.0030.00518.39
8.0.270.0070.00017.24
8.0.260.0000.00617.25
8.0.250.0030.00316.98
8.0.240.0060.00016.98
8.0.230.0000.00716.95
8.0.220.0030.00316.92
8.0.210.0070.00016.88
8.0.200.0000.00716.95
8.0.190.0040.00416.93
8.0.180.0000.00816.89
8.0.170.0020.00516.93
8.0.160.0050.00216.93
8.0.150.0040.00416.91
8.0.140.0030.00716.80
8.0.130.0000.00613.32
8.0.120.0000.00816.77
8.0.110.0000.00916.89
8.0.100.0000.00816.77
8.0.90.0040.00416.70
8.0.80.0030.01316.89
8.0.70.0000.00816.88
8.0.60.0070.00016.90
8.0.50.0070.00016.89
8.0.30.0110.00617.06
8.0.20.0120.01117.40
8.0.10.0070.00016.84
8.0.00.0080.01016.64
7.4.330.0050.00016.84
7.4.320.0030.00316.59
7.4.300.0000.00616.54
7.4.290.0000.00716.44
7.4.280.0050.00516.44
7.4.270.0040.00416.62
7.4.260.0030.00516.50
7.4.250.0050.00216.46
7.4.240.0020.00516.46
7.4.230.0050.00216.49
7.4.220.0060.01516.60
7.4.210.0090.00816.57
7.4.200.0070.00016.70
7.4.160.0030.01316.64
7.4.150.0090.01517.40
7.4.140.0170.01017.86
7.4.130.0120.00816.48
7.4.120.0110.00616.50
7.4.110.0120.00916.73
7.4.100.0100.00616.49
7.4.90.0090.00916.57
7.4.80.0090.00919.39
7.4.70.0100.00716.58
7.4.60.0060.00916.50
7.4.50.0050.00516.55
7.4.40.0030.01316.51
7.4.30.0090.01116.54
7.4.00.0090.00615.10
7.3.330.0030.00313.38
7.3.320.0030.00313.30
7.3.310.0040.00416.36
7.3.300.0050.00216.40
7.3.290.0000.00716.31
7.3.280.0090.01016.31
7.3.270.0160.00017.40
7.3.260.0070.01016.48
7.3.250.0080.01116.47
7.3.240.0110.00816.41
7.3.230.0110.00816.64
7.3.210.0080.00816.29
7.3.200.0030.01216.26
7.3.190.0130.01216.39
7.3.180.0090.00616.72
7.3.170.0080.00816.27
7.3.160.0170.00316.23
7.3.120.0060.00914.51
7.3.110.0040.01415.08
7.3.100.0060.00614.46
7.3.90.0040.00815.15
7.3.80.0070.00714.77
7.3.70.0050.00314.60
7.3.60.0000.00914.66
7.3.50.0040.00414.80
7.3.40.0070.00314.91
7.3.30.0030.01014.70
7.3.20.0140.00016.72
7.3.10.0000.01316.52
7.3.00.0000.00916.39
7.2.330.0140.00716.55
7.2.320.0030.01416.55
7.2.310.0040.01416.29
7.2.300.0070.01016.37
7.2.290.0070.01016.33
7.2.240.0060.00815.26
7.2.230.0030.00915.29
7.2.220.0110.00414.59
7.2.210.0030.01014.83
7.2.200.0120.00614.69
7.2.190.0060.00814.59
7.2.180.0030.01014.86
7.2.170.0080.00815.00
7.2.160.0030.01014.78
7.2.150.0090.00616.66
7.2.140.0030.00916.84
7.2.130.0070.01016.76
7.2.120.0030.01416.83
7.2.110.0040.00716.83
7.2.100.0060.00816.89
7.2.90.0000.01217.08
7.2.80.0100.00016.98
7.2.70.0110.00416.94
7.2.60.0000.01416.91
7.2.50.0040.00817.01
7.2.40.0000.01616.69
7.2.30.0030.01016.96
7.2.20.0070.00416.89
7.2.10.0030.01016.74
7.2.00.0080.00818.07
7.1.330.0040.01116.02
7.1.320.0090.00615.86
7.1.310.0030.00616.14
7.1.300.0120.00415.95
7.1.290.0060.00915.59
7.1.280.0070.00715.77
7.1.270.0000.00815.84
7.1.260.0080.00315.75
7.1.250.0030.01015.90
7.1.200.0060.00615.47
7.1.100.0000.01218.46
7.1.70.0070.00317.36
7.1.60.0140.01119.13
7.1.50.0120.00616.70
7.1.00.0000.08022.36
7.0.200.0030.00616.80
7.0.60.0070.04319.93
7.0.50.0030.05017.88
7.0.40.0100.05020.21
7.0.30.0270.04020.09
7.0.20.0430.06720.10
7.0.10.0070.07020.23
7.0.00.0030.04720.24
5.6.280.0070.06321.02
5.6.210.0030.04020.52
5.6.200.0030.08718.21
5.6.190.0130.07720.33
5.6.180.0370.05020.47
5.6.170.0430.07320.47
5.6.160.0070.04020.57
5.6.150.0130.07718.18
5.6.140.0100.05018.17
5.6.130.0000.04318.18
5.6.120.0200.06721.01
5.6.110.0030.04321.10
5.6.100.0100.08020.97
5.6.90.0170.08021.11
5.6.80.0100.07720.32
5.5.350.0100.07720.54
5.5.340.0030.05018.00
5.5.330.0000.04320.27
5.5.320.0130.08320.30
5.5.310.0230.06720.36
5.5.300.0070.08017.98
5.5.290.0170.07017.95
5.5.280.0070.04320.66
5.5.270.0100.08020.77
5.5.260.0100.08020.88
5.5.250.0070.08020.70
5.5.240.0030.06320.15

preferences:
58.04 ms | 403 KiB | 5 Q