3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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';
based on e8LPh
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function readline() in /in/5gKv4:4 Stack trace: #0 {main} thrown in /in/5gKv4 on line 4
Process exited with code 255.
Output for 5.4.9 - 5.6.28
Fatal error: Call to undefined function readline() in /in/5gKv4 on line 4
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/5gKv4 on line 5
Process exited with code 255.