Does the order of arguments in a conditional statement affect execution time in php?
- by dd0x
Hi,
As far as I know when writing a conditional statement in C such as the following:
if ( some_function() == 100 && my_var
== 5 ) { //do something }
is slower to execute than
if ( my_var == 5 && some_function() ==
100 ) { //do something }
because it's faster to execute the my_var == 5 rather than all of the code in the function ( because if my_var != 5, then the rest of the if statement would not even be executed )...so I am wondering if the same is true for conditional statements in PHP?