3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $myVar = false; $myVar[] = 'Hello'; // Converted into an array var_dump($myVar); $myVar = true; $myVar[] = 'Hello'; // Converted into an array var_dump($myVar);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(1) { [0]=> string(5) "Hello" } Warning: Cannot use a scalar value as an array in /in/7TWWr on line 6 bool(true)