3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lines = file('mytextfile.txt'); $lines = array_slice($lines, 100); $i = 0; foreach($lines as $line) { if(str_contains($line, $keyword)) { echo $line; $i++; if ($i >= 20) { break; } } }
Output for git.master, git.master_jit
Warning: file(): open_basedir restriction in effect. File(mytextfile.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/3ONSS on line 3 Warning: file(mytextfile.txt): Failed to open stream: Operation not permitted in /in/3ONSS on line 3 Fatal error: Uncaught TypeError: array_slice(): Argument #1 ($array) must be of type array, bool given in /in/3ONSS:4 Stack trace: #0 /in/3ONSS(4): array_slice(false, 100) #1 {main} thrown in /in/3ONSS on line 4
Process exited with code 255.
Output for rfc.property-hooks
Warning: file(): open_basedir restriction in effect. File(mytextfile.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/3ONSS on line 3 Warning: file(mytextfile.txt): Failed to open stream: Operation not permitted in /in/3ONSS on line 3 Fatal error: Uncaught TypeError: array_slice(): Argument #1 ($array) must be of type array, false given in /in/3ONSS:4 Stack trace: #0 /in/3ONSS(4): array_slice(false, 100) #1 {main} thrown in /in/3ONSS on line 4
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
182.25 ms | 407 KiB | 5 Q