Advertisement
adrenalinkin

AbsoluteFunctionReferenceBench

Jan 28th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2.  
  3. declare(strict_types=1);
  4.  
  5. namespace Acme;
  6.  
  7. class AbsoluteFunctionReferenceBench
  8. {
  9.  
  10.     public function benchRelativeReference() : void
  11.     {
  12.         for ($i = 0; $i < 100; $i++) {
  13.             get_class($this);
  14.         }
  15.  
  16.         usleep(1);
  17.     }
  18.  
  19.     public function benchAbsoluteReference() : void
  20.     {
  21.         for ($i = 0; $i < 100; $i++) {
  22.             \get_class($this);
  23.         }
  24.  
  25.         usleep(1);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement