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
Convert intval to typecast int #491
Comments
Does the speed increase apply to
Actually, is |
There is also a bunch of occurrences for |
We need to do the replacement for floatval too but the amount of occurrences is much lower. As for the captcha, shouldn't be needed to replace by anything. |
There is a |
For consistency, yes it should be changed to a typecast. |
I just think that we should focus on important things rather than tiny details right now, but I guess that's just me. |
Not only ;) we can change this in a few seconds before we release beta 1, 2 or even before the final release - we should finish the jQuery conversion and release beta 1 ASAP |
I was just pointing it out. I didn't see this mentioned before. On Fri, May 9, 2014 at 8:16 PM, Jones notifications@github.com wrote:
|
We can push this on Beta 1 and leave the rest of possible type-casting for beta 2. Who is the one to apply this? IIRC there were no issues on the tests done. |
I can do this, not a problem. But I'll only be able to look at this Thursday - though I believe there's no rush. We still have jQuery to complete. |
Do it as late as possible, it may break pull requests and other stuff. |
Stefan is right, we should do this only when we're about to release Beta 1. |
Looks like Beta 2 then? |
Yeah |
I didn't forget it - we can't risk losing PR compatibility until a few days before Beta 2 is ready. I postponed it to Beta 2. |
I am of the opinion that this should be one of the last changes made before final testing. As mentioned it will effect almost every active PR so it would be best to finish all open issues (are as many as are feasible) before making this change. |
Postponing to Beta 3. |
@PirataNervo remember this is to be pushed at the last moment, we should get all enhancements and PRs done by then. |
@Sama34 yeap I remember :) |
This is finished. |
Before: We need to find more occurrences of this... (if there are any) |
Nice catch Jordan! |
Right, there are more locations. Here's the list of all of them...
Some |
Yes the converted skipped array_maps. But I'll fix those manually now. Thanks Jordan. |
@JordanMussi I think some of those locations are not right. I guess you probably just searched array_map rather than array_map("(int) I've fixed 16 occurrences, going to commit now. |
I think this can be closed now. |
There are still some PHP parse errors. The array_map functions in 12096ed are all missing a closing parentheses ( ) ). |
Oops, forgot the converter did that too. Fixed that and the (int)(int) found in one file. |
I've gone through many many pages and didn't find any parse errors related to this, so I'm closing this issue. |
Speed Tests Reference:
http://hakre.wordpress.com/2010/05/13/php-casting-vs-intval/
The speed increase is incredible and since we have a lot of intval's, I decided to write a script to help me out.
PHP Script:
http://pastebin.com/Qjfk1WEh
Usage: intval.php?dir=[PATH]
The text was updated successfully, but these errors were encountered: