3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $regEx = "/^[0-9]*$/"; $pass= "Y"; $fail= "N"; $value = 1; $value = 0; $value = "true"; $value = "false"; $value = true; //$value = false; //returns Y //$value = "hello"; //returns N //$value = 32452345; //returns N if ((preg_match($regEx, $value) && ($value == 1 || $value == 0)) || $value === true || $value === false) { echo $pass; } else{ echo $fail; }
based on J5XjW
Output for 4.3.0 - 7.2.0
Y