3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function rScan($dir){ $list = array(); $items = preg_grep($this->iRegex,scandir($dir)); foreach($items as $item){ if(is_file("$dir/$item")){ $list[] = $item; continue; } $list[$item] = $rrScan("$dir/$item"); } return $list; } var_dump(rScan('/'));
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Using $this when not in object context in /in/oSsv7:4 Stack trace: #0 /in/oSsv7(15): rScan('/') #1 {main} thrown in /in/oSsv7 on line 4
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: this in /in/oSsv7 on line 4 Notice: Cannot access property on non-object in /in/oSsv7 on line 4 Warning: Permission denied in /in/oSsv7 on line 4 Warning: preg_grep() expects parameter 2 to be array, boolean given in /in/oSsv7 on line 4 Warning: Invalid argument supplied for foreach() in /in/oSsv7 on line 11 array(0) { }
Output for 5.0.0 - 5.6.28
Fatal error: Using $this when not in object context in /in/oSsv7 on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: Undefined variable: this in /in/oSsv7 on line 4 Fatal error: Call to undefined function: scandir() in /in/oSsv7 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: Undefined variable: this in /in/oSsv7 on line 4 Fatal error: Call to undefined function: scandir() in /in/oSsv7 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: this in /in/oSsv7 on line 4 Fatal error: Call to undefined function: scandir() in /in/oSsv7 on line 4