3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function foo($a, $b) { $a + $b; } } function row($name, $t) { printf("%-40s %8s x 10 µs\n", $name, number_format((microtime(true)-$t)*1e5, 2)); } $max = 5*1e1; $object = new A; $t = microtime (true); for ($i=0; $i<$max; $i++) { $object->foo(1, 'foo'); } row($max.' x A::foo', $t); $t = microtime (true); for ($i=0; $i<$max; $i++) { call_user_func_array(array($object, 'foo'), array(1, 'foo')); } row($max.' x call_user_func_array', $t); $t = microtime (true); $ref = new ReflectionMethod($object, 'foo'); for ($i=0; $i<$max; $i++) { $ref->invokeArgs($object, array(1, 'foo')); } row($max.' x ReflectionMethod::invokeArgs', $t); $t = microtime (true); for ($j=0; $j<$max/10; $j++) { $ref = new ReflectionMethod($object, 'foo'); for ($i=0; $i<10; $i++) { $ref->invokeArgs($object, array(1, 'foo')); } } row(($max/10).' x (10 x ReflectionMethod::invokeArgs)', $t);

Abusive script

This script was stopped while abusing our resources

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.00.0070.01115.26
7.3.120.0030.01515.11
7.3.110.0090.00915.02
7.3.100.0070.01315.01
7.3.90.0070.00714.91
7.3.80.0040.01214.88
7.3.70.0090.00614.86
7.3.60.0090.00614.93
7.3.50.0040.00814.90
7.3.40.0100.00714.87
7.3.30.0030.01014.70
7.3.20.0110.00416.75
7.3.10.0060.00916.76
7.3.00.0060.00616.88
7.2.250.0100.01015.08
7.2.240.0030.01014.93
7.2.230.0000.01715.18
7.2.220.0040.01214.99
7.2.210.0000.01415.04
7.2.200.0060.01015.07
7.2.190.0090.00615.11
7.2.180.0040.00715.05
7.2.170.0070.01115.10
7.2.160.0090.00914.99
7.2.150.0130.00617.07
7.2.140.0060.01016.93
7.2.130.0040.00816.95
7.2.120.0070.01116.80
7.2.110.0120.00016.72
7.2.100.0030.00916.97
7.2.90.0040.00816.82
7.2.80.0090.00916.86
7.2.70.0100.00316.73
7.2.60.0040.01217.13
7.2.50.0070.00716.91
7.2.40.0130.00016.74
7.2.30.0070.01016.99
7.2.20.0100.00716.86
7.2.10.0100.00716.70
7.2.00.0050.00918.05
7.1.330.0030.01415.91
7.1.320.0000.01615.88
7.1.310.0030.00615.89
7.1.300.0060.01015.95
7.1.290.0040.01115.80
7.1.280.0070.01015.82
7.1.270.0040.01415.85
7.1.260.0060.00915.68
7.1.250.0060.00915.86
7.1.240.0000.01615.68
7.1.230.0100.00315.71
7.1.220.0040.01215.94
7.1.210.0000.01515.55
7.1.200.0060.00615.85
7.1.190.0000.01415.94
7.1.180.0040.00415.54
7.1.170.0030.01015.67
7.1.160.0070.01115.95
7.1.150.0040.00715.93
7.1.140.0070.01015.63
7.1.130.0000.01515.96
7.1.120.0000.01715.54
7.1.110.0040.01115.96
7.1.100.0030.01315.70
7.1.90.0090.00615.71
7.1.80.0070.01015.64
7.1.70.0060.00616.36
7.1.60.0100.01017.75
7.1.50.0080.01016.37
7.1.40.0060.00615.82
7.1.30.0100.00715.68
7.1.20.0060.00915.71
7.1.10.0030.01415.75
7.1.00.0050.04319.09
7.0.330.0000.01015.48
7.0.320.0070.00715.46
7.0.310.0000.01015.20
7.0.300.0030.01015.42
7.0.290.0040.01215.52
7.0.280.0090.00615.38
7.0.270.0070.01015.22
7.0.260.0060.00915.61
7.0.250.0100.00715.42
7.0.240.0030.01015.63
7.0.230.0040.01115.64
7.0.220.0030.00915.37
7.0.210.0040.00415.19
7.0.200.1010.00315.11
7.0.190.0030.00715.50
7.0.180.0060.00315.44
7.0.170.0100.00715.34
7.0.160.0080.00615.41
7.0.150.0000.01515.47
7.0.140.0050.04018.72
7.0.130.0070.01115.27
7.0.120.0110.00315.41
7.0.110.0030.01215.55
7.0.100.0090.00615.42
7.0.90.0060.00615.50
7.0.80.0090.00315.55
7.0.70.0000.01615.19
7.0.60.0100.04317.72
7.0.50.0090.04616.88
7.0.40.0070.04816.70
7.0.30.0130.02616.73
7.0.20.0180.03616.95
7.0.10.0050.04816.80
7.0.00.0090.04716.81
5.6.400.0040.01114.63
5.6.390.0040.00714.72
5.6.380.0040.01114.61
5.6.370.0030.01214.54
5.6.360.0040.01214.04
5.6.350.0070.01014.51
5.6.340.0000.01414.40
5.6.330.0080.00814.17
5.6.320.0030.01014.21
5.6.310.0090.00313.99
5.6.300.0000.01214.14
5.6.290.0090.00614.54
5.6.280.0050.04017.46
5.6.270.0060.00314.50
5.6.260.0040.00714.30
5.6.250.0070.01014.43
5.6.240.0030.01114.45
5.6.230.0030.01314.47
5.6.220.0080.00814.23
5.6.210.0090.02017.40
5.6.200.0070.04816.36
5.6.190.0120.03017.37
5.6.180.1800.02417.52
5.6.170.0240.03817.47
5.6.160.0030.04317.56
5.6.150.0020.03416.28
5.6.140.0020.05016.26
5.6.130.0020.05116.27
5.6.120.0050.03717.74
5.6.110.0130.03817.71
5.6.100.0050.04617.83
5.6.90.0080.04317.65
5.6.80.0070.03517.29
5.6.70.2150.02317.35
5.6.60.0090.00614.11
5.6.50.0060.00613.92
5.6.40.0000.01114.43
5.6.30.0120.00314.02
5.6.20.0100.00714.19
5.6.10.0090.00314.34
5.6.00.0130.00014.33
5.5.380.0100.00314.43
5.5.370.0000.01414.44
5.5.360.0000.01314.40
5.5.350.0080.02717.16
5.5.340.0100.02016.00
5.5.330.0130.03317.42
5.5.320.1820.02217.38
5.5.310.0170.04217.35
5.5.300.0070.02016.19
5.5.290.0030.03416.03
5.5.280.0060.04217.60
5.5.270.0070.03217.65
5.5.260.0080.03817.45
5.5.250.0030.04717.56
5.5.240.0110.03717.31
5.5.230.0110.00314.34
5.5.220.0120.00414.18
5.5.210.0140.00014.23
5.5.200.0110.00313.96
5.5.190.0060.01014.13
5.5.180.0030.01314.40
5.5.170.0120.00413.88
5.5.160.0080.00814.37
5.5.150.0000.01214.30
5.5.140.0030.01314.13
5.5.130.0040.01214.32
5.5.120.0040.01113.72
5.5.110.0060.01014.36
5.5.100.0120.00313.83
5.5.90.0070.00714.24
5.5.80.0030.01114.30
5.5.70.0090.00614.35
5.5.60.0070.01114.07
5.5.50.0070.00714.31
5.5.40.0000.01414.20
5.5.30.0120.00313.99
5.5.20.0120.00614.38
5.5.10.0070.01114.25
5.5.00.0060.01214.29
5.4.450.0240.02220.41
5.4.440.0230.02720.41
5.4.430.0270.02420.41
5.4.420.0220.02220.41
5.4.410.0340.02420.41
5.4.400.0220.02220.11
5.4.390.0180.02119.89
5.4.380.0120.02515.56
5.4.370.0120.02515.63
5.4.360.0080.03815.50
5.4.350.0080.03315.56
5.4.340.0080.02915.52
5.4.330.0040.00812.54
5.4.320.0020.02412.53
5.4.310.0090.01912.52
5.4.300.0070.03512.53
5.4.290.0080.02912.53
5.4.280.0050.03012.47
5.4.270.0040.03112.47
5.4.260.0090.02212.48
5.4.250.0070.02312.47
5.4.240.0060.02212.47
5.4.230.0060.02512.47
5.4.220.0040.02412.47
5.4.210.0060.02212.47
5.4.200.0060.02312.47
5.4.190.0060.02512.47
5.4.180.0090.02712.47
5.4.170.0070.02912.47
5.4.160.0040.02912.47
5.4.150.0080.02512.47
5.4.140.0100.02412.31
5.4.130.0060.02612.30
5.4.120.0050.03012.28
5.4.110.0050.02912.28
5.4.100.0030.03012.28
5.4.90.0100.02512.28
5.4.80.0060.02812.28
5.4.70.0060.02712.28
5.4.60.0040.03012.28
5.4.50.0040.03012.28
5.4.40.0040.03012.27
5.4.30.0070.02812.27
5.4.20.0070.02712.27
5.4.10.0070.02612.27
5.4.00.0050.02912.02
5.3.290.0110.02412.67
5.3.280.0040.03112.62
5.3.270.0040.03212.63
5.3.260.0070.02812.63
5.3.250.0070.02912.63
5.3.240.0080.02812.63
5.3.230.0060.02712.62
5.3.220.0050.02112.61
5.3.210.0050.02212.61
5.3.200.0030.02412.61
5.3.190.0050.02612.61
5.3.180.0020.02312.60
5.3.170.0020.02412.60
5.3.160.0050.02012.60
5.3.150.0040.02412.60
5.3.140.0040.02512.60
5.3.130.0080.02012.60
5.3.120.0050.02312.60
5.3.110.0040.02512.60
5.3.100.0050.02312.34
5.3.90.0120.02312.33
5.3.80.0050.02612.33
5.3.70.0090.02012.33
5.3.60.0100.01712.32
5.3.50.0050.02312.29
5.3.40.0020.02512.29
5.3.30.0060.02212.27
5.3.20.0080.02012.16
5.3.10.0040.02312.14
5.3.00.0040.02412.13
5.2.170.0050.0329.25
5.2.160.0050.0309.26
5.2.150.0050.0329.26
5.2.140.0050.0329.25
5.2.130.0050.0429.21
5.2.120.0060.0389.21
5.2.110.0050.0409.22
5.2.100.0090.0339.22
5.2.90.0080.0389.21
5.2.80.0110.0369.21
5.2.70.0080.0329.21
5.2.60.0030.0349.16
5.2.50.0060.0349.13
5.2.40.0080.0289.11
5.2.30.0050.0339.09
5.2.20.0060.0299.07
5.2.10.0070.0299.00
5.2.00.0040.0408.86
5.1.60.0120.0318.14
5.1.50.0110.0308.14
5.1.40.0060.0348.12
5.1.30.0070.0358.48
5.1.20.0090.0338.49
5.1.10.0100.0308.22
5.1.00.0070.0358.23
5.0.50.0040.0296.71
5.0.40.0070.0256.57
5.0.30.0100.0356.38
5.0.20.0100.0206.36
5.0.10.0150.0176.34
5.0.00.0100.0346.33
4.4.90.0040.0224.78
4.4.80.0110.0154.75
4.4.70.0040.0194.76
4.4.60.0040.0154.76
4.4.50.0040.0164.77
4.4.40.0040.0254.71
4.4.30.0000.0194.76
4.4.20.0030.0174.84
4.4.10.0050.0144.85
4.4.00.0020.0274.76
4.3.110.0020.0174.67
4.3.100.0000.0194.66
4.3.90.0030.0164.64
4.3.80.0030.0274.63
4.3.70.0040.0164.63
4.3.60.0050.0164.63
4.3.50.0030.0174.63
4.3.40.0050.0284.56
4.3.30.0020.0223.37
4.3.20.0020.0223.35
4.3.10.0010.0223.30
4.3.00.0070.01326.73

preferences:
40.77 ms | 401 KiB | 5 Q