3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Read all lines from the specified URL and store them in an array $all_lines = file('https://www.w3resource.com/'); // Iterate through each line in the array foreach ($all_lines as $line_num => $line) { // Display the line number and the HTML-escaped content of the line echo "Line No.-{$line_num}: " . htmlspecialchars($line) . "\n"; } ?>
Output for 8.3.0 - 8.3.7
Warning: file(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/VAgDW on line 3 Warning: file(): open_basedir restriction in effect. File(https://www.w3resource.com/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/VAgDW on line 3 Warning: file(https://www.w3resource.com/): Failed to open stream: Operation not permitted in /in/VAgDW on line 3 Warning: foreach() argument must be of type array|object, false given in /in/VAgDW on line 6
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.19
Warning: file(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/VAgDW on line 3 Warning: file(): open_basedir restriction in effect. File(https://www.w3resource.com/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/VAgDW on line 3 Warning: file(https://www.w3resource.com/): Failed to open stream: Operation not permitted in /in/VAgDW on line 3 Warning: foreach() argument must be of type array|object, bool given in /in/VAgDW on line 6

preferences:
80.16 ms | 403 KiB | 62 Q