3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function isDiff($old, $new) { if ($old === null || is_string($old) && ($new === null || is_bool($new) || is_numeric($new)) && strcmp($old, $new) === 0) { return false; } return true; } var_dump(isDiff("05", 5)); var_dump(isDiff(5, 5.0)); var_dump(isDiff(true, 1));
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(true) bool(true) bool(true)