3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ 'false' => false, 'true' => true, 'null' => null, '0' => 0, '0.1' => 0.1, 'a' => 'a', '[\'foo\']' => ['foo'], '(object) [\'bar\', \'bar\']' => (object) ['bar', 'bar'], ]; echo "<table border=1>"; echo '<tr><th>input</th><th>echo</th><th>printf</th><th>print_r</th><th>var_export</th><th>var_dump</th></tr>'; foreach ($tests as $input => $test) { echo "<tr>"; echo "<th>$input</th><td>"; echo is_array($test) || is_object($test) ? json_encode($test) : $test; echo "</td><td>"; printf('%s', is_array($test) || is_object($test) ? json_encode($test) : $test); echo "</td><td>"; print_r($test); echo "</td><td>"; var_export($test); echo "</td><td>"; var_dump($test); echo "</td></tr>"; } echo "</table>";

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.4.120.0060.00524.23
8.4.110.0090.01222.68
8.4.100.0130.00919.04
8.4.90.0100.00218.83
8.4.80.0130.00720.59
8.4.70.0140.00618.14
8.4.60.0040.00418.85
8.4.50.0050.00420.24
8.4.40.0090.00917.90
8.4.30.0060.00318.74
8.4.20.0040.00417.91
8.4.10.0050.00319.65
8.3.250.0090.01019.15
8.3.240.0110.00917.36
8.3.230.0060.00416.87
8.3.220.0110.00919.23
8.3.210.0120.00816.54
8.3.200.0010.00816.92
8.3.190.0110.00317.37
8.3.180.0110.00917.13
8.3.170.0100.00720.68
8.3.160.0070.01416.95
8.3.150.0170.00317.03
8.3.140.0060.00316.92
8.3.130.0040.00418.33
8.3.120.0030.00618.73
8.3.110.0080.00016.77
8.3.100.0060.00316.46
8.3.90.0050.00326.77
8.3.80.0090.00018.68
8.3.70.0240.00018.43
8.3.60.0160.00318.56
8.3.50.0070.01416.67
8.3.40.0000.01420.26
8.3.30.0120.00620.17
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0070.00328.09
8.2.290.0040.00520.54
8.2.280.0100.01018.75
8.2.270.0150.00317.39
8.2.260.0000.00816.80
8.2.250.0030.00618.54
8.2.240.0090.00017.45
8.2.230.0030.00620.94
8.2.220.0030.00824.06
8.2.210.0060.00326.77
8.2.200.0060.00318.16
8.2.190.0120.00618.66
8.2.180.0180.00416.75
8.2.170.0110.00719.19
8.2.160.0100.00722.96
8.2.150.0080.00025.66
8.2.140.0050.00324.66
8.2.130.0030.00528.09
8.2.120.0050.00328.09
8.2.110.0030.00628.09
8.2.100.0060.00328.09
8.2.90.0080.00028.09
8.2.80.0060.00628.09
8.2.70.0120.00028.09
8.2.60.0100.00328.09
8.2.50.0130.00028.09
8.2.40.0090.00328.09
8.2.30.0040.00828.09
8.2.20.0090.00328.09
8.2.10.0070.00428.09
8.2.00.0050.00528.09
8.1.330.0120.00722.10
8.1.320.0110.01116.05
8.1.310.0070.00316.92
8.1.300.0030.00620.18
8.1.290.0110.00030.84
8.1.280.0150.00025.92
8.1.270.0030.00622.01
8.1.260.0080.00028.09
8.1.250.0080.00028.09
8.1.240.0000.00828.09
8.1.230.0070.00328.09
8.1.220.0040.00428.09
8.1.210.0040.00428.09
8.1.200.0000.00928.09
8.1.190.0000.01028.09
8.1.180.0060.00328.09
8.1.170.0050.00528.09
8.1.160.0100.00028.09
8.1.150.0070.00328.09
8.1.140.0090.00028.09
8.1.130.0040.00428.09
8.1.120.0050.00528.09
8.1.110.0090.00028.09
8.1.100.0060.00328.09
8.1.90.0060.00328.09
8.1.80.0000.01128.09
8.1.70.0080.00328.09
8.1.60.0000.00828.09
8.1.50.0030.00628.09
8.1.40.0030.00628.09
8.1.30.0040.00428.09
8.1.20.0040.00428.09
8.1.10.0040.00428.09
8.1.00.0040.00428.09

preferences:
30.45 ms | 403 KiB | 5 Q