3v4l.org

run code in 300+ PHP versions simultaneously
<?php $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__, RecursiveDirectoryIterator::CURRENT_AS_PATHNAME)); var_dump(iterator_to_array($iterator));
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.25, 7.3.27 - 7.3.29, 7.3.33, 7.4.5, 7.4.7, 7.4.9 - 7.4.11, 7.4.14 - 7.4.16, 7.4.21 - 7.4.22, 7.4.26 - 7.4.33, 8.0.2 - 8.0.3, 8.0.7 - 8.0.9, 8.0.13, 8.0.15 - 8.0.30, 8.1.0 - 8.1.17, 8.1.19 - 8.1.27, 8.2.0 - 8.2.9, 8.2.11 - 8.2.18, 8.3.0 - 8.3.3, 8.3.6
array(3) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/BhhFW"]=> string(9) "/in/BhhFW" }
Output for 8.3.5
array(4) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/DQcTF"]=> string(9) "/in/DQcTF" ["/in/BhhFW"]=> string(9) "/in/BhhFW" }
Output for 8.3.4
array(4) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/3YEIL"]=> string(9) "/in/3YEIL" ["/in/BhhFW"]=> string(9) "/in/BhhFW" }
Output for 8.2.10
array(4) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/BhhFW"]=> string(9) "/in/BhhFW" ["/in/CDeJE"]=> string(9) "/in/CDeJE" }
Output for 8.1.28
array(4) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/BnRRm"]=> string(9) "/in/BnRRm" ["/in/BhhFW"]=> string(9) "/in/BhhFW" }
Output for 8.1.18
array(4) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/sh5Bd"]=> string(9) "/in/sh5Bd" ["/in/BhhFW"]=> string(9) "/in/BhhFW" }
Output for 8.0.14
array(4) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/BhhFW"]=> string(9) "/in/BhhFW" ["/in/5lF1s"]=> string(9) "/in/5lF1s" }
Output for 8.0.1, 8.0.5 - 8.0.6, 8.0.10 - 8.0.12
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/in): Failed to open directory: Permission denied in /in/BhhFW:3 Stack trace: #0 /in/BhhFW(3): RecursiveDirectoryIterator->__construct('/in', 32) #1 {main} thrown in /in/BhhFW on line 3
Process exited with code 255.
Output for 8.0.0
array(4) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/dob5B"]=> string(9) "/in/dob5B" ["/in/BhhFW"]=> string(9) "/in/BhhFW" }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.6, 7.3.12, 7.3.30 - 7.3.32, 7.4.0, 7.4.19 - 7.4.20, 7.4.23 - 7.4.25
Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/in): failed to open dir: Permission denied in /in/BhhFW:3 Stack trace: #0 /in/BhhFW(3): RecursiveDirectoryIterator->__construct('/in', 32) #1 {main} thrown in /in/BhhFW on line 3
Process exited with code 255.
Output for 7.4.13
array(4) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/Lanqb"]=> string(9) "/in/Lanqb" ["/in/BhhFW"]=> string(9) "/in/BhhFW" }
Output for 7.4.12
array(4) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/NRBFm"]=> string(9) "/in/NRBFm" ["/in/BhhFW"]=> string(9) "/in/BhhFW" }
Output for 7.4.8
array(5) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/ZbI3O"]=> string(9) "/in/ZbI3O" ["/in/7sjLZ"]=> string(9) "/in/7sjLZ" ["/in/BhhFW"]=> string(9) "/in/BhhFW" }
Output for 7.4.6
array(4) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/GHQd7"]=> string(9) "/in/GHQd7" ["/in/BhhFW"]=> string(9) "/in/BhhFW" }
Output for 7.4.4
array(10) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/Jq9FO"]=> string(9) "/in/Jq9FO" ["/in/f9V7s"]=> string(9) "/in/f9V7s" ["/in/rcdPY"]=> string(9) "/in/rcdPY" ["/in/KTakK"]=> string(9) "/in/KTakK" ["/in/J7H2j"]=> string(9) "/in/J7H2j" ["/in/BhhFW"]=> string(9) "/in/BhhFW" ["/in/s76dY"]=> string(9) "/in/s76dY" ["/in/38mul"]=> string(9) "/in/38mul" }
Output for 7.4.3
array(4) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/ELPE0"]=> string(9) "/in/ELPE0" ["/in/BhhFW"]=> string(9) "/in/BhhFW" }
Output for 7.3.26
array(4) { ["/in/."]=> string(5) "/in/." ["/in/.."]=> string(6) "/in/.." ["/in/uMFT1"]=> string(9) "/in/uMFT1" ["/in/BhhFW"]=> string(9) "/in/BhhFW" }
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/in): failed to open dir: Permission denied' in /in/BhhFW:3 Stack trace: #0 /in/BhhFW(3): RecursiveDirectoryIterator->__construct('/in', 32) #1 {main} thrown in /in/BhhFW on line 3
Process exited with code 255.
Output for 5.1.3 - 5.1.6, 5.2.0 - 5.2.17
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/BhhFW on line 3 Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/BhhFW:3 Stack trace: #0 /in/BhhFW(3): RecursiveDirectoryIterator->__construct('__DIR__', 32) #1 {main} thrown in /in/BhhFW on line 3
Process exited with code 255.
Output for 5.1.2
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/BhhFW on line 3 Fatal error: Uncaught exception 'RuntimeException' with message 'RecursiveDirectoryIterator::__construct(__DIR__): failed to open dir: No such file or directory' in /in/BhhFW:3 Stack trace: #0 /in/BhhFW(3): RecursiveDirectoryIterator->__construct('__DIR__', 32) #1 {main} thrown in /in/BhhFW on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.1
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/BhhFW on line 3 Fatal error: Undefined class constant 'CURRENT_AS_PATHNAME' in /in/BhhFW on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')', expecting '(' in /in/BhhFW on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected ')', expecting '(' in /in/BhhFW on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/BhhFW on line 3
Process exited with code 255.

preferences:
245.88 ms | 401 KiB | 314 Q