Created
April 16, 2013 07:36
-
-
Save ronan-gloo/5394115 to your computer and use it in GitHub Desktop.
This file contains 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 | |
namespace Project\Raw { | |
define('VT', 100000); | |
$mt['NS no Backslash']['start'] = microtime(true); | |
for ($i = 0; $i < VT; $i++) { | |
is_array(VT); | |
is_string(VT); | |
is_object(VT); | |
is_bool(VT); | |
is_int(VT); | |
is_resource(VT); | |
is_null(VT); | |
} | |
$mt['NS no Backslash']['end'] = microtime(true); | |
} | |
namespace Project\Slash { | |
$mt['NS with Backslash']['start'] = microtime(true); | |
for ($i = 0; $i < VT; $i++) { | |
\is_array(VT); | |
\is_string(VT); | |
\is_object(VT); | |
\is_bool(VT); | |
\is_int(VT); | |
\is_resource(VT); | |
\is_null(VT); | |
} | |
$mt['NS with Backslash']['end'] = microtime(true); | |
} | |
namespace { | |
$mt['NS Global no Backslash']['start'] = microtime(true); | |
for ($i = 0; $i < VT; $i++) { | |
is_array(VT); | |
is_string(VT); | |
is_object(VT); | |
is_bool(VT); | |
is_int(VT); | |
is_resource(VT); | |
is_null(VT); | |
} | |
$mt['NS Global no Backslash']['end'] = microtime(true); | |
} | |
namespace { | |
$mt['NS Global with Backslash']['start'] = microtime(true); | |
for ($i = 0; $i < VT; $i++) { | |
\is_array(VT); | |
\is_string(VT); | |
\is_object(VT); | |
\is_bool(VT); | |
\is_int(VT); | |
\is_resource(VT); | |
\is_null(VT); | |
} | |
$mt['NS Global with Backslash']['end'] = microtime(true); | |
foreach ($mt as $name => $interval) | |
{ | |
echo round($interval['end'] - $interval['start'], 5).': '.$name.PHP_EOL; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment