3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function truthy($value){ return in_array($value, array(true,1,'y','yes','true')); } var_dump(truthy('n')); var_dump(truthy('yes')); var_dump(truthy('no')); var_dump(truthy('false')); var_dump(truthy(false));
based on XGUTQ
Output for 4.3.0 - 7.1.0
bool(true) bool(true) bool(true) bool(true) bool(false)