Skip to content

Instantly share code, notes, and snippets.

@gms8994
Created April 26, 2011 19:52
Show Gist options
  • Save gms8994/942982 to your computer and use it in GitHub Desktop.
Save gms8994/942982 to your computer and use it in GitHub Desktop.
Benchmark Comparison
<?php
class Test {
public function test() {
return "abcd1234";
}
}
<?php
echo "abcd1234";
#!/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