-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any reason for root-namespaced php built-in functions? #49
Comments
There isn't. This was just code ported from Slim 3. I missed it during the code review. You can PR that if you want! |
FYI; Using the root-namespaced function calls is a micro performance optimization. In short it is because PHP compiler will optimize internal functions call. Problem with non root namespaced function calls is that the compiler does not know if it is calling a root function or a function within the current namespace, because the compiler only parses a single file at a time. |
@JoeBengalen I'd like to add more tests to the |
Oki, if it is required sure. Just wanted you to be aware of it :) |
Is it really worth it to drop performance improvements for kind of "better" unit tests? |
@danopz I'd much rather have test coverage than a micro-optimization that really doesn't make a difference on the grand scheme of things. |
In
\Slim\Psr7\NonBufferedBody::write()
there are four function calls to php built-in functions. All of them are root-namespaced.ob_get_level
ob_get_clean
flush
strlen
Is there any reason for that?
Slim-Psr7/src/NonBufferedBody.php
Lines 99 to 107 in 636bea0
The text was updated successfully, but these errors were encountered: