3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $files = scandir('ftp://ftp.cetip.com.br/MediaCDI/', SCANDIR_SORT_DESCENDING); $newest_file = $files[0]; $fh = fopen($newest_file, 'r'); echo $fh;
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: scandir(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/KrphB on line 2 Warning: scandir(): connect() failed: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/KrphB on line 2 Warning: scandir(ftp://ftp.cetip.com.br/MediaCDI/): failed to open dir: operation failed in /in/KrphB on line 2 Warning: scandir(): (errno 111): Connection refused in /in/KrphB on line 2 Warning: fopen(): Filename cannot be empty in /in/KrphB on line 4
Output for hhvm-3.12.0
Warning: Unknown URI scheme "ftp" in /in/KrphB on line 2 Warning: fopen() expects parameter 1 to be string, null given in /in/KrphB on line 4
Output for hhvm-3.10.0
Warning: Unknown URI scheme "ftp" in /in/KrphB on line 2 Warning: Filename cannot be empty in /in/KrphB on line 4
Output for 5.2.9 - 5.3.29
Notice: Use of undefined constant SCANDIR_SORT_DESCENDING - assumed 'SCANDIR_SORT_DESCENDING' in /in/KrphB on line 2 Warning: scandir() expects parameter 2 to be long, string given in /in/KrphB on line 2 Warning: fopen(): Filename cannot be empty in /in/KrphB on line 4
Output for 5.0.0 - 5.2.8
Notice: Use of undefined constant SCANDIR_SORT_DESCENDING - assumed 'SCANDIR_SORT_DESCENDING' in /in/KrphB on line 2 Warning: scandir() expects parameter 2 to be long, string given in /in/KrphB on line 2
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: scandir() in /in/KrphB on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: scandir() in /in/KrphB on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: scandir() in /in/KrphB on line 2