3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(1, (bool) 1); var_dump(0, (bool) 0); var_dump('1', (bool) '1'); var_dump('1kljf;hag', (bool) '1kljf;hag'); var_dump((bool) array()); var_dump((bool) array(0));
Output for 4.3.0 - 7.1.0
int(1) bool(true) int(0) bool(false) string(1) "1" bool(true) string(9) "1kljf;hag" bool(true) bool(false) bool(true)