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";

preferences:
30.95 ms | 404 KiB | 5 Q