3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $form_validation_rules = array( array('field' => 'email', 'label' => 'E-Mail-Adresse', 'rules' => 'trim|is_unique[bdb_users.email]|valid_email|required|xss_clean'), array('field' => 'first_name', 'label' => 'Vorname', 'rules' => 'trim|required|xss_clean'), array('field' => 'last_name', 'label' => 'Nachname', 'rules' => 'trim|required|xss_clean'), array('field' => 'tel', 'label' => 'Telefon', 'rules' => 'trim|required|xss_clean'), array('field' => 'address', 'label' => 'Adresse', 'rules' => 'trim|required|xss_clean'), array('field' => 'company', 'label' => 'Unternehmen', 'rules' => 'trim|required|xss_clean'), array('field' => 'password', 'label' => 'Passwort', 'rules' => 'trim|required|xss_clean'), array('field' => 'position', 'label' => 'Position', 'rules' => 'trim|xss_clean'), array('field' => 'department', 'label' => 'Abteilung', 'rules' => 'trim|xss_clean'), array('field' => 'credits', 'label' => 'Credits', 'rules' => 'trim|required|xss_clean|integer'), ); $x = array_map(function($element){return $element['field'];}, $form_validation_rules); var_dump($x);
based on pgWZ7
Output for 5.3.0 - 7.1.0
array(10) { [0]=> string(5) "email" [1]=> string(10) "first_name" [2]=> string(9) "last_name" [3]=> string(3) "tel" [4]=> string(7) "address" [5]=> string(7) "company" [6]=> string(8) "password" [7]=> string(8) "position" [8]=> string(10) "department" [9]=> string(7) "credits" }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/sZVfi on line 16
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/sZVfi on line 16
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/sZVfi on line 16
Process exited with code 255.