Created
          April 26, 2011 19:52 
        
      - 
      
- 
        Save gms8994/942982 to your computer and use it in GitHub Desktop. 
    Benchmark Comparison
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| class Test { | |
| public function test() { | |
| return "abcd1234"; | |
| } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| echo "abcd1234"; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/php | |
| <?php | |
| require_once "bench.php"; | |
| cmp_these( | |
| array( | |
| 'classer();', | |
| 'includer();', | |
| ), 100000 | |
| ); | |
| function classer() { | |
| include_once "tmp/class_vs_include/1.php"; | |
| $class = new Test(); | |
| print $class->test(); | |
| } | |
| function includer() { | |
| include "tmp/class_vs_include/2.php"; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment