3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $requiredAttributes = array('email', 'id', 'first_name', 'last_name'); $user= array('email' => 1, ); $missing = array_diff_key(array_flip($requiredAttributes), $user); var_dump($missing); if (array('1')) { var_dump("hello"); }
based on L9cBs
Output for 5.1.0 - 7.1.0
array(3) { ["id"]=> int(1) ["first_name"]=> int(2) ["last_name"]=> int(3) } string(5) "hello"
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function array_diff_key() in /in/9gr2p on line 5
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_diff_key() in /in/9gr2p on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_diff_key() in /in/9gr2p on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_diff_key() in /in/9gr2p on line 5