3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test=readdir("."); echo $test; echo system("ls"); echo passthru("ls"); echo exec("ls"); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught TypeError: readdir(): Argument #1 ($dir_handle) must be of type resource or null, string given in /in/Ws50W:2 Stack trace: #0 /in/Ws50W(2): readdir('.') #1 {main} thrown in /in/Ws50W on line 2
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: readdir() expects parameter 1 to be resource, string given in /in/Ws50W on line 2 Warning: system(): Unable to fork [ls] in /in/Ws50W on line 4 Warning: passthru(): Unable to fork [ls] in /in/Ws50W on line 5 Warning: exec(): Unable to fork [ls] in /in/Ws50W on line 6
Output for 5.2.3 - 5.2.17
Warning: readdir(): supplied argument is not a valid Directory resource in /in/Ws50W on line 2 Warning: system(): Unable to fork [ls] in /in/Ws50W on line 4 Warning: passthru(): Unable to fork [ls] in /in/Ws50W on line 5 Warning: exec(): Unable to fork [ls] in /in/Ws50W on line 6
Output for 4.4.3 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
<br /> <b>Warning</b>: readdir(): supplied argument is not a valid Directory resource in <b>/in/Ws50W</b> on line <b>2</b><br /> <br /> <b>Warning</b>: system() [<a href='function.system'>function.system</a>]: Unable to fork [ls] in <b>/in/Ws50W</b> on line <b>4</b><br /> <br /> <b>Warning</b>: passthru() [<a href='function.passthru'>function.passthru</a>]: Unable to fork [ls] in <b>/in/Ws50W</b> on line <b>5</b><br /> <br /> <b>Warning</b>: exec() [<a href='function.exec'>function.exec</a>]: Unable to fork [ls] in <b>/in/Ws50W</b> on line <b>6</b><br />
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.2
<br /> <b>Warning</b>: readdir(): supplied argument is not a valid Directory resource in <b>/in/Ws50W</b> on line <b>2</b><br /> <br /> <b>Warning</b>: system(): Unable to fork [ls] in <b>/in/Ws50W</b> on line <b>4</b><br /> <br /> <b>Warning</b>: passthru(): Unable to fork [ls] in <b>/in/Ws50W</b> on line <b>5</b><br /> <br /> <b>Warning</b>: exec(): Unable to fork [ls] in <b>/in/Ws50W</b> on line <b>6</b><br />
Output for 4.3.0 - 4.3.1
<br /> <b>Warning</b>: readdir(): supplied argument is not a valid Directory resource in <b>/in/Ws50W</b> on line <b>2</b><br /> <br /> <b>Warning</b>: system() [<a href='http://www.php.net/function.system'>function.system</a>]: Unable to fork [ls] in <b>/in/Ws50W</b> on line <b>4</b><br /> <br /> <b>Warning</b>: passthru() [<a href='http://www.php.net/function.passthru'>function.passthru</a>]: Unable to fork [ls] in <b>/in/Ws50W</b> on line <b>5</b><br /> <br /> <b>Warning</b>: exec() [<a href='http://www.php.net/function.exec'>function.exec</a>]: Unable to fork [ls] in <b>/in/Ws50W</b> on line <b>6</b><br />

preferences:
326.87 ms | 402 KiB | 464 Q