3v4l.org

run code in 300+ PHP versions simultaneously
<?php require_once 'readline.php'; $len = readline('Insert lenght of the array' . PHP_EOL); $arr = []; $mid = $len / 2; for ($i = 0; $i < $len; $i++) { $arr[] = readline('Insert number' . PHP_EOL); if ($len % 2 !== 0 && $arr[ceil($mid) + 1] == [ceil($mid) + 1] ) { $ismirror = true; }elseif ($len % 2 == 0 && $arr[$mid] == $arr[$mid +1] && $arr[$mid - 1] == $arr[$mid + 2]){ $ismirror = true; } } echo $ismirror ? 'Yes' : 'No';
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Warning: require_once(): open_basedir restriction in effect. File(readline.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/e8LPh on line 3 Warning: require_once(readline.php): Failed to open stream: Operation not permitted in /in/e8LPh on line 3 Fatal error: Uncaught Error: Failed opening required 'readline.php' (include_path='.:') in /in/e8LPh:3 Stack trace: #0 {main} thrown in /in/e8LPh on line 3
Process exited with code 255.
Output for 8.0.13
Warning: require_once(readline.php): Failed to open stream: No such file or directory in /in/e8LPh on line 3 Fatal error: Uncaught Error: Failed opening required 'readline.php' (include_path='.:') in /in/e8LPh:3 Stack trace: #0 {main} thrown in /in/e8LPh on line 3
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.3.32 - 7.3.33, 7.4.26, 7.4.33
Warning: require_once(readline.php): failed to open stream: No such file or directory in /in/e8LPh on line 3 Fatal error: require_once(): Failed opening required 'readline.php' (include_path='.:') in /in/e8LPh on line 3
Process exited with code 255.
Output for 7.1.25 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.32
Warning: require_once(): open_basedir restriction in effect. File(readline.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/e8LPh on line 3 Warning: require_once(readline.php): failed to open stream: Operation not permitted in /in/e8LPh on line 3 Fatal error: require_once(): Failed opening required 'readline.php' (include_path='.:') in /in/e8LPh on line 3
Process exited with code 255.

preferences:
174.33 ms | 403 KiB | 226 Q