fork download
  1. <?php
  2. function no_suppress() {
  3. $a = 0;
  4. $b = new stdClass;
  5. $a = (isset($b->asdf) ? $b->asdf : null);
  6. }
  7. function suppress() {
  8. $a = 0;
  9. $b = new stdClass;
  10. $a = @$b->asdf ? $b->asdf : null;
  11. }
  12. function do_test($suppress = false, $loops = 1000000) {
  13. if($suppress) {
  14. echo "starting suppress...\n";
  15. $start = microtime(true);
  16. for($i = 0; $i < $loops; $i++) {
  17. suppress();
  18. }
  19. $end = microtime(true);
  20. } else {
  21. echo "starting no_suppress...\n";
  22. $start = microtime(true);
  23. for($i = 0; $i < $loops; $i++) {
  24. no_suppress(true);
  25. }
  26. $end = microtime(true);
  27. }
  28. echo "ended: " . ($end - $start) . "\n";
  29. }
  30. do_test();
  31. do_test(true);
Success #stdin #stdout 2.84s 52472KB
stdin
Standard input is empty
stdout
starting no_suppress...
ended: 0.79577279090881
starting suppress...
ended: 2.0292670726776