3v4l.org

run code in 300+ PHP versions simultaneously
<?php const ITERATIONS = 100000; $start = microtime(true); for ($i = 0; $i < ITERATIONS; $i++) { try { throw new Exception($i); } catch (\Throwable $e) { } } $end = microtime(true); $total = $end - $start; echo "Throwing exceptions: $total\n"; $start = microtime(true); for ($i = 0; $i < ITERATIONS; $i++) { new Exception($i); } $end = microtime(true); $total = $end - $start; echo "Creating exceptions: $total\n"; $start = microtime(true); for ($i = 0; $i < ITERATIONS; $i++) { new stdClass(); } $end = microtime(true); $total = $end - $start; echo "Creating stdClass : $total\n"; $start = microtime(true); for ($i = 0; $i < ITERATIONS; $i++) { new Attribute(); } $end = microtime(true); $total = $end - $start; echo "Creating Attribute : $total\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.4.60.0290.05517.86
8.4.50.0380.05517.90
8.4.40.0230.04217.23
8.4.30.0190.06417.45
8.4.20.0400.05917.43
8.4.10.0250.04517.55
8.3.200.0210.07716.06
8.3.190.0230.04016.79
8.3.180.0340.05816.62
8.3.170.0160.04116.50
8.3.160.0230.03816.66
8.3.150.0220.04216.45
8.3.140.0250.03716.16
8.3.130.0310.04116.59
8.3.120.0210.05916.55
8.3.110.0270.08416.31
8.3.100.0350.06316.57
8.3.90.0150.04216.71
8.3.80.0160.04116.68
8.3.70.0280.04316.61
8.3.60.0200.03916.57
8.3.50.0320.03816.40
8.3.40.0220.04017.49
8.3.30.0150.03817.62
8.3.20.0130.04017.29
8.3.10.0140.04117.55
8.3.00.0150.03817.57
8.2.280.0280.05916.80
8.2.270.0190.06216.24
8.2.260.0150.03916.64
8.2.250.0250.03716.46
8.2.240.0130.04016.54
8.2.230.0270.03816.47
8.2.220.0150.03816.62
8.2.210.0190.04016.36
8.2.200.0110.04116.56
8.2.190.0270.05216.60
8.2.180.0250.06316.48
8.2.170.0180.05317.98
8.2.160.0270.04517.69
8.2.150.0260.03517.56
8.2.140.0290.03417.35
8.2.130.0190.03617.75
8.2.120.0120.04117.45
8.2.110.0150.04217.71
8.2.100.0280.05617.38
8.2.90.0340.05817.60
8.2.80.0320.06617.60
8.2.70.0310.05417.36
8.2.60.0320.05517.52
8.2.50.0160.03917.48
8.2.40.0120.04017.50
8.2.30.0320.05617.41
8.2.20.0310.05617.29
8.2.10.0280.05617.52
8.2.00.0130.03917.29

preferences:
49.22 ms | 403 KiB | 5 Q