3v4l.org

run code in 300+ PHP versions simultaneously
<?php $context = array('test' => true); // optionally fill-in the test value with lots of data for ($i = 0; $i < 100000; $i++) { $context['test'][$i] = $i; } // you can also just create a big string // $context = str_repeat(' ', 1000000); // benchmark $time = microtime(true); for ($i = 0; $i < 100; $i++) { // the snippet of code to benchmark $tmp = isset($context['test']) ? $context['test'] : ''; } printf("TIME: %0.2d\n", (microtime(true) - $time) * 1000) . PHP_EOL; // benchmark $time = microtime(true); for ($i = 0; $i < 100; $i++) { // the snippet of code to benchmark $tmp = ''; if (isset($context['test'])) { $tmp = $context['test']; } } printf("TIME: %0.2d\n", (microtime(true) - $time) * 1000);

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.0110.01116.21
7.3.00.0210.00516.50
7.2.130.0080.01016.82
7.2.120.0050.01316.43
7.2.110.0260.00916.59
7.2.100.0060.01416.56
7.2.90.0300.00716.69
7.2.80.0230.01116.77
7.2.70.0240.00016.69
7.2.60.0210.01016.39
7.2.50.0290.01016.17
7.2.40.0280.00917.02
7.2.30.0230.00416.76
7.2.20.0040.00916.87
7.2.10.0210.00715.86
7.2.00.0100.00817.94
7.1.250.0330.00315.74
7.1.70.0080.00017.14
7.1.60.0030.01319.34
7.1.50.0040.01817.08
7.1.00.0070.07322.17
7.0.200.0040.00416.93
7.0.140.0030.05322.23
7.0.60.0100.07719.94
7.0.50.0030.08317.84
7.0.40.0200.07719.82
7.0.30.0230.06019.91
7.0.20.0330.08019.71
7.0.10.0270.08019.84
7.0.00.0070.08319.84
5.6.280.0070.07021.04
5.6.210.0100.08020.70
5.6.200.0030.09018.13
5.6.190.0000.04720.36
5.6.180.0270.03020.49
5.6.170.0330.07720.38
5.6.160.0100.06320.39
5.6.150.0130.07718.18
5.6.140.0030.05718.10
5.6.130.0130.05318.15
5.6.120.0030.05021.05
5.6.110.0200.07021.13
5.6.100.0100.07020.93
5.6.90.0070.08020.97
5.6.80.0100.06020.52
5.6.70.4230.03720.38
5.5.350.0130.08020.41
5.5.340.0100.07717.94
5.5.330.0070.05019.95
5.5.320.0300.04020.15
5.5.310.0100.04720.09
5.5.300.0030.07717.91
5.5.290.0070.08317.91
5.5.280.0100.08020.87
5.5.270.0030.04720.86
5.5.260.0070.08320.75
5.5.250.0000.06720.59
5.5.240.0070.06320.15
5.4.450.0230.05019.28
5.4.440.4030.04319.29
5.4.430.0130.07319.01
5.4.420.0230.04019.38
5.4.410.0070.06719.34
5.4.400.0370.07019.00
5.4.390.0070.03719.12
5.4.380.0170.03319.17
5.4.370.0330.07018.94
5.4.360.0400.04318.87
5.4.350.0100.05013.72
5.4.340.0170.03313.66
5.4.320.0130.03714.11
5.4.310.0130.04014.20
5.4.300.0130.03714.32
5.4.290.0170.03714.15
5.4.280.0130.03314.10
5.4.270.0130.03714.09
5.4.260.0170.03714.09
5.4.250.0070.04714.05
5.4.240.0100.03714.10
5.4.230.0030.05314.00
5.4.220.0070.04014.04
5.4.210.0130.03314.09
5.4.200.0200.03713.98
5.4.190.0100.04314.05
5.4.180.0130.03313.96
5.4.170.0100.04014.02
5.4.160.0130.04014.02
5.4.150.0070.04714.17
5.4.140.0170.03713.76
5.4.130.0130.03313.77
5.4.120.0030.04313.64
5.4.110.0130.03713.80
5.4.100.0100.04013.80
5.4.90.0030.04313.69
5.4.80.0130.05013.64
5.4.70.0130.03713.66
5.4.60.0170.03013.65
5.4.50.0100.04013.64
5.4.40.0070.04013.66
5.4.30.0100.04013.70
5.4.20.0130.03713.70
5.4.10.0030.04313.86
5.4.00.0130.03313.27

preferences:
31.37 ms | 400 KiB | 5 Q