3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //$filedir = "upload"; function showDir( $filedir ) { //打开目录 $dir = @ dir($filedir); //列出目录中的文件 while (($file = $dir->read())!==false) //while(($file = readdir($dir)) !== false) { if(is_dir($filedir."/".$file) AND ($file!=".") AND ($file!="..")) { // echo "dirname: ".$file."<br />"; showDir($filedir."/".$file); } else { echo "filename: " .$filedir."/".$file . "<br />"; } } $dir->close(); } showDir("."); ?>
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to a member function read() on boolean in /in/OigE0:7 Stack trace: #0 /in/OigE0(20): showDir('.') #1 {main} thrown in /in/OigE0 on line 7
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Fatal error: Call to a member function read() on boolean in /in/OigE0 on line 7
Process exited with code 255.
Output for 5.5.0 - 5.5.38
Fatal error: Call to a member function read() on a non-object in /in/OigE0 on line 7
Process exited with code 255.