3v4l.org

run code in 300+ PHP versions simultaneously
<?php $required = ['k1', 'k2']; $data = [ 'k1' => 'v1', ]; $required == array_intersect($required, array_keys($data))
Output for 5.4.17
Parse error: syntax error, unexpected end of file in /in/FnLjT on line 9
Process exited with code 255.
Output for 5.4.0 - 5.4.16
Parse error: syntax error, unexpected end of file in XY4GV on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.24, 5.3.26
Parse error: syntax error, unexpected '[' in XY4GV on line 3
Process exited with code 255.
Output for 5.3.25
Parse error: syntax error, unexpected '[' in /in/FnLjT on line 3
Process exited with code 255.

preferences:
181.03 ms | 1395 KiB | 52 Q