3v4l.org

run code in 200+ 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.2.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 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