3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php print <<<EOF <!DOCTYPE html><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><head> <link rel="shortcut icon" href="../img/bla.gif"/><title>ゴミ箱</title><body> EOF; $res_dir = opendir( '.' ); while( $file_name = readdir( $res_dir ) ){ if($file_name == "index.php"){ }else { if($file_name == "."){ }else { if($file_name == ".."){ }else { print <<<EOF <li><a href="./$file_name">$file_name</a></li> EOF; } } } } closedir( $res_dir ); print <<<EOF </body></html> EOF; ?>
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
<!DOCTYPE html><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><head> <link rel="shortcut icon" href="../img/bla.gif"/><title>ゴミ箱</title><body> Warning: opendir(.): failed to open dir: Permission denied in /in/AVRh7 on line 6 Warning: readdir() expects parameter 1 to be resource, boolean given in /in/AVRh7 on line 7 Warning: closedir() expects parameter 1 to be resource, boolean given in /in/AVRh7 on line 21 </body></html>
Output for hhvm-3.10.0 - 3.12.0
<!DOCTYPE html><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><head> <link rel="shortcut icon" href="../img/bla.gif"/><title>ゴミ箱</title><body> Warning: Permission denied in /in/AVRh7 on line 6 Warning: readdir() expects parameter 1 to be resource, boolean given in /in/AVRh7 on line 7 Warning: closedir() expects parameter 1 to be resource, boolean given in /in/AVRh7 on line 21 </body></html>
Output for 4.3.2 - 4.4.1, 4.4.3 - 5.1.1, 5.1.3 - 5.2.17
<!DOCTYPE html><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><head> <link rel="shortcut icon" href="../img/bla.gif"/><title>ゴミ箱</title><body> Warning: opendir(.): failed to open dir: Permission denied in /in/AVRh7 on line 6 Warning: readdir(): supplied argument is not a valid Directory resource in /in/AVRh7 on line 7 Warning: closedir(): supplied argument is not a valid Directory resource in /in/AVRh7 on line 21 </body></html>
Output for 4.4.2, 5.1.2
<!DOCTYPE html><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><head> <link rel="shortcut icon" href="../img/bla.gif"/><title>ゴミ箱</title><body> Warning: opendir(.): failed to open dir: Permission denied in /in/AVRh7 on line 7 Warning: readdir(): supplied argument is not a valid Directory resource in /in/AVRh7 on line 8 Warning: closedir(): supplied argument is not a valid Directory resource in /in/AVRh7 on line 23 </body></html>
Output for 4.3.0 - 4.3.1
<!DOCTYPE html><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><head> <link rel="shortcut icon" href="../img/bla.gif"/><title>ゴミ箱</title><body> Warning: opendir(.) [http://www.php.net/function.opendir]: failed to open dir: Permission denied in /in/AVRh7 on line 6 Warning: readdir(): supplied argument is not a valid Directory resource in /in/AVRh7 on line 7 Warning: closedir(): supplied argument is not a valid Directory resource in /in/AVRh7 on line 21 </body></html>