run code in 200+ php & hhvm versions
Bugs & Features
<?php $o = new stdClass; $o->text = "ans1"; $o2 = new stdClass; $o2->text = "ans2"; $o3 = new stdClass; $o3->text = "ans3"; $arr = [$o, $o2, $o3]; var_dump($arr); $nu = array_map($arr,callback); function callback($e) { return $e->text; } var_dump($nu);

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Arrow functions
array(3) { [0]=> object(stdClass)#1 (1) { ["text"]=> string(4) "ans1" } [1]=> object(stdClass)#2 (1) { ["text"]=> string(4) "ans2" } [2]=> object(stdClass)#3 (1) { ["text"]=> string(4) "ans3" } } Notice: Use of undefined constant callback - assumed 'callback' in /in/S8KDF on line 16 Warning: array_map() expects parameter 1 to be a valid callback, array must have exactly two members in /in/S8KDF on line 16 NULL

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page