3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $mVar = '2'; $bVar = (bool)$mVar; //cast bool to in echo var_dump($mVar); var_dump($bVar);
based on HWvIq
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(1) "2" bool(true)