<?php
namespace Foo {
class Bar {
public function baz() {
return strlen('Regarding the overhead: Just keep in mind, that a typical application calls built-in functions many thousand times. Even if the difference is small: It exists.');
}
}
$start = microtime(true);
$foo = new Foo\Bar;
for($x = 0; $x < 1000000; $x++) {
$foo->baz();
}
echo "Time: " . round((microtime(true) - $start ) / 1000000, 5) . 's';
}
Fatal error: Uncaught Error: Class "Foo\Foo\Bar" not found in /in/u3Pm9:10
Stack trace:
#0 {main}
thrown in /in/u3Pm9 on line 10
Process exited with code 255.
Fatal error: Uncaught Error: Class 'Foo\Foo\Bar' not found in /in/u3Pm9:10
Stack trace:
#0 {main}
thrown in /in/u3Pm9 on line 10
Process exited with code 255.