3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function checkArray($sourceValue) { $createdArray = (array) $sourceValue; var_export($sourceValue); var_export($createdArray); var_export(empty($createdAray)); } checkArray(null); checkArray(false); checkArray(''); checkArray($undefined);
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
NULLarray ( )truefalsearray ( 0 => false, )true''array ( 0 => '', )true Notice: Undefined variable: undefined in /in/ARaC4 on line 2 NULLarray ( )true
Output for 4.3.0 - 5.0.3
NULLarray ( )truefalsearray ( 0 => false, )true''array ( 0 => '', )true Notice: Undefined variable: undefined in /in/ARaC4 on line 2 NULLarray ( )true