3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startTime = microtime(true); for ($i = 0; $i < 5000000; $i++) { $foo = 'foo'; $bar = 'bar'; $baz = 'baz'; $array = compact('foo', 'bar', 'baz'); } $endTime = microtime(true); $elapsed = $endTime - $startTime; echo "With compact : $elapsed seconds\n"; $startTime = microtime(true); for ($i = 0; $i < 5000000; $i++) { $array = [ 'foo' => 'foo', 'bar' => 'bar', 'baz' => 'baz' ]; } $endTime = microtime(true); $elapsed = $endTime - $startTime; echo "Without compact time : $elapsed seconds\n";

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.100.0310.35837.54
8.3.90.0170.30137.54
8.3.80.0160.29637.54
8.3.70.0170.30337.54
8.3.60.0340.30237.54
8.3.50.0240.33137.54
8.3.40.0200.33237.54
8.3.30.0130.30737.54
8.3.20.0270.33037.54
8.3.10.0300.32737.54
8.3.00.0300.31537.54
8.2.220.0200.31137.54
8.2.210.0200.29537.54
8.2.200.0230.32637.54
8.2.190.0230.31737.54
8.2.180.0230.29137.54
8.2.170.0230.33937.54
8.2.160.0240.33637.54
8.2.150.0430.31737.54
8.2.140.0290.33037.54
8.2.130.0300.33837.54
8.2.120.0130.31037.54
8.2.110.0100.31237.54
8.2.100.0420.31437.54
8.2.90.0230.29537.54
8.2.80.0300.29837.54
8.2.70.0370.32137.54
8.2.60.0200.31437.54
8.2.50.0200.34437.54
8.2.40.0100.31437.54
8.2.30.0230.30837.54
8.2.20.0000.31237.54
8.2.10.0170.31037.54
8.2.00.0230.35237.54
8.1.290.0300.33037.54
8.1.280.0300.31637.54
8.1.270.0130.30537.54
8.1.260.0270.31437.54
8.1.250.0360.32937.54
8.1.240.0170.33437.54
8.1.230.0390.31237.54
8.1.220.0130.30037.54
8.1.210.0140.30837.54
8.1.200.0140.30337.54
8.1.190.0200.29637.54
8.1.180.0460.32537.54
8.1.170.0160.30037.54
8.1.160.0230.31437.54
8.1.150.0030.31237.54
8.1.140.0230.34437.54
8.1.130.0070.31637.54
8.1.120.0200.30337.54
8.1.110.0200.34937.54
8.1.100.0130.34337.54
8.1.90.0230.33437.54
8.1.80.0270.33337.54
8.1.70.0170.32337.54
8.1.60.0270.29237.54
8.1.50.0170.29837.54
8.1.40.0370.30737.54
8.1.30.0200.30137.54
8.1.20.0200.33837.54
8.1.10.0200.30437.54
8.1.00.0200.31137.54

preferences:
51.88 ms | 779 KiB | 5 Q