5. str_replace() vs. ereg_replace() and preg_replace()
ereg_replace(): 26.65647 seconds
preg_replace(): 25.18324 seconds
str_replace(): 10.26872 seconds
6. Pre-increment is faster than post-increment
Post-increment: 2.148 seconds
Pre-increment: 1.692 seconds
7. Regular Expressions for input validation?
Regular Expressions: 2.401 seconds
ctype_digit: 0.985 seconds
split(): 5.453 seconds
explode(): 3.556 seconds
9. Use time() rather than date('U')
date('U'): 19.162 seconds
time(): 0.057 seconds
while(++$a<100000000){}: 15.519 seconds
for(;++$a<100000000;){}: 17.577 seconds
do{}while(++$a<100000000): 13.744 seconds
11. is_numeric() vs. ctype_digit()
is_numeric(): 9.943268 seconds
ctype_digit(): 11.801991 seconds
14. === (Identical) vs. == (Equal)
==: 4.194739 seconds
===: 3.510191 seconds
15. intval('100') vs. (int)'100'
intval('100'): 6.441137 seconds
(int)'100': 2.933663 seconds