3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $element = array( 0 => array( 'name' => 'test', 'email' => 'aaa@example.com' ), 1 => array( 'name' => 'testing', 'email' => 'aaa@example.com' ), 2 => array( 'name' => 'Jane Doe', 'email' => 'asd@example.com' )); $array = array_map(function($element) { return $element['name']; }, $element); $array2 = (array_count_values($array)); print_r($array2);
based on Pa2MA
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [test] => 1 [testing] => 1 [Jane Doe] => 1 )
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/dSSS0 on line 17
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/dSSS0 on line 17
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/dSSS0 on line 17
Process exited with code 255.