<?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";
You have javascript disabled. You will not be able to edit any code.