2 ms·
The $var == "" issue is more understandable when you realize that PHP attempts to do type coercion to test comparison for all data types, while the equality ope
by ihsw 14y ago
The $var == "" issue is more understandable when you realize that PHP attempts to do type coercion to test comparison for all data types, while the equality operator (triple equals, ===) does not attempt to do type coercion.
Also, foreach(range(1, 1000 * 1000) as $i) will execute at roughly the same speed as for($i = 0, $count = 1000 * 1000; $i < $count; $i++), so the difference is negligible.