3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $types = array('string', 1, null, '1', '', '0', 0, 0.0, array(), new StdClass, true, false, null); foreach ($types as $type) { print_r((array) $type); }
based on QpAED
Output for 4.3.0 - 7.1.0
Array ( [0] => string ) Array ( [0] => 1 ) Array ( ) Array ( [0] => 1 ) Array ( [0] => ) Array ( [0] => 0 ) Array ( [0] => 0 ) Array ( [0] => 0 ) Array ( ) Array ( ) Array ( [0] => 1 ) Array ( [0] => ) Array ( )