3v4l.org

run code in 300+ PHP versions simultaneously
<?php function assign() { trigger_error('foo', E_USER_WARNING); return "test"; } $t = assign(); function errorHandler() {} function testEh() { $start = microtime(); set_error_handler('errorHandler'); $a = assign(); restore_error_handler(); return microtime() - $start; } $sumMicrotime = 0; for($i = 0; $i < 10000; $i++) { $sumMicrotime += testEh(); } echo "avg (errorhandler): " . ($sumMicrotime / 10000); echo "\n"; function testAt() { $start = microtime(); $b = @assign(); return microtime() - $start; } $sumMicrotime = 0; for($i = 0; $i < 10000; $i++) { $sumMicrotime += testAt(); } echo "avg (shut-up): " . ($sumMicrotime / 10000);

preferences:
31.18 ms | 407 KiB | 5 Q