3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$uri='http://www.yodlecareers.com/puzzles/triangle.txt'; $uri='input.txt'; //$file = fopen($uri,'r'); //var_dump($file);die; $rows = file($uri, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); echo count($rows),'<br>'; var_dump($rows[4]);
Output for 8.3.0 - 8.3.6
Warning: file(): open_basedir restriction in effect. File(input.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/XMpc8 on line 9 Warning: file(input.txt): Failed to open stream: Operation not permitted in /in/XMpc8 on line 9 Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given in /in/XMpc8:10 Stack trace: #0 {main} thrown in /in/XMpc8 on line 10
Process exited with code 255.
Output for 8.0.10 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Warning: file(): open_basedir restriction in effect. File(input.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/XMpc8 on line 9 Warning: file(input.txt): Failed to open stream: Operation not permitted in /in/XMpc8 on line 9 Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /in/XMpc8:10 Stack trace: #0 {main} thrown in /in/XMpc8 on line 10
Process exited with code 255.
Output for 8.0.13
Warning: file(input.txt): Failed to open stream: No such file or directory in /in/XMpc8 on line 9 Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /in/XMpc8:10 Stack trace: #0 {main} thrown in /in/XMpc8 on line 10
Process exited with code 255.
Output for 8.0.0 - 8.0.9
Warning: file(): open_basedir restriction in effect. File(input.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/XMpc8 on line 9 Warning: file(input.txt): Failed to open stream: Operation not permitted in /in/XMpc8 on line 9 Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, bool given in /in/XMpc8:10 Stack trace: #0 {main} thrown in /in/XMpc8 on line 10
Process exited with code 255.
Output for 7.4.33
Warning: file(input.txt): failed to open stream: No such file or directory in /in/XMpc8 on line 9 Warning: count(): Parameter must be an array or an object that implements Countable in /in/XMpc8 on line 10 1<br> Notice: Trying to access array offset on value of type bool in /in/XMpc8 on line 11 NULL
Output for 7.4.0 - 7.4.32
Warning: file(): open_basedir restriction in effect. File(input.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/XMpc8 on line 9 Warning: file(input.txt): failed to open stream: Operation not permitted in /in/XMpc8 on line 9 Warning: count(): Parameter must be an array or an object that implements Countable in /in/XMpc8 on line 10 1<br> Notice: Trying to access array offset on value of type bool in /in/XMpc8 on line 11 NULL
Output for 7.2.0, 7.3.32 - 7.3.33
Warning: file(input.txt): failed to open stream: No such file or directory in /in/XMpc8 on line 9 Warning: count(): Parameter must be an array or an object that implements Countable in /in/XMpc8 on line 10 1<br>NULL
Output for 7.2.17 - 7.2.33, 7.3.0 - 7.3.31
Warning: file(): open_basedir restriction in effect. File(input.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/XMpc8 on line 9 Warning: file(input.txt): failed to open stream: Operation not permitted in /in/XMpc8 on line 9 Warning: count(): Parameter must be an array or an object that implements Countable in /in/XMpc8 on line 10 1<br>NULL
Output for 7.2.6
Warning: file(): open_basedir restriction in effect. File(input.txt) is not within the allowed path(s): (/tmp:/in) in /in/XMpc8 on line 9 Warning: file(input.txt): failed to open stream: Operation not permitted in /in/XMpc8 on line 9 Warning: count(): Parameter must be an array or an object that implements Countable in /in/XMpc8 on line 10 1<br>NULL
Output for 7.1.26 - 7.1.33
Warning: file(): open_basedir restriction in effect. File(input.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/XMpc8 on line 9 Warning: file(input.txt): failed to open stream: Operation not permitted in /in/XMpc8 on line 9 1<br>NULL
Output for 7.1.20
Warning: file(): open_basedir restriction in effect. File(input.txt) is not within the allowed path(s): (/tmp:/in) in /in/XMpc8 on line 9 Warning: file(input.txt): failed to open stream: Operation not permitted in /in/XMpc8 on line 9 1<br>NULL
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.37, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10
Warning: file(input.txt): failed to open stream: No such file or directory in /in/XMpc8 on line 9 1<br>NULL
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Notice: Use of undefined constant FILE_IGNORE_NEW_LINES - assumed 'FILE_IGNORE_NEW_LINES' in /in/XMpc8 on line 9 Notice: Use of undefined constant FILE_SKIP_EMPTY_LINES - assumed 'FILE_SKIP_EMPTY_LINES' in /in/XMpc8 on line 9 Warning: file(input.txt): failed to open stream: No such file or directory in /in/XMpc8 on line 9 1<br>NULL
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant FILE_IGNORE_NEW_LINES - assumed 'FILE_IGNORE_NEW_LINES' in /in/XMpc8 on line 9 Notice: Use of undefined constant FILE_SKIP_EMPTY_LINES - assumed 'FILE_SKIP_EMPTY_LINES' in /in/XMpc8 on line 9 Warning: file(input.txt) [http://www.php.net/function.file]: failed to create stream: No such file or directory in /in/XMpc8 on line 9 1<br>NULL

preferences:
240.15 ms | 402 KiB | 380 Q