3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $items = glob('./*'); for ($i = 0; $i < count($items); $i++) { if (is_dir($items[$i])) { $add = glob($items[$i] . '/*'); $items = array_merge($items, $add); } } echo $items;
Output for 7.2.6
Warning: count(): Parameter must be an array or an object that implements Countable in /in/eCFc6 on line 4 Warning: count(): Parameter must be an array or an object that implements Countable in /in/eCFc6 on line 4
Output for 5.4.0 - 7.1.10, 7.2.0
Notice: Array to string conversion in /in/eCFc6 on line 11 Array
Output for 4.3.7 - 4.3.8, 7.1.20
Output for 4.3.0 - 4.3.6, 4.3.9 - 5.3.29
Array