3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(); $array['mes'] = ''; if array_key_exists( 'mes', $array ){ echo "mes exsits\n"; }else{ echo "mes not exsits\n"; } if array_key_exists( 'hoge', $array ){ echo "mes exsits\n"; }else{ echo "mes not exsits\n"; } if ($array['mes']) { echo "y"; }else{ echo "n"; } if ($array['hoge']) { echo "y"; }else{ echo "n"; }
Output for 5.4.1 - 5.4.45, 5.5.24 - 5.5.29, 5.6.8 - 5.6.13
Parse error: syntax error, unexpected 'array_key_exists' (T_STRING), expecting '(' in /in/vlg0k on line 5
Process exited with code 255.

preferences:
153.03 ms | 1435 KiB | 7 Q