3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // create array of objects: $arr = []; for ($i = 0, $max = 3; $i < $max; $i++) { $arr[] = new stdClass; } $arr[0]->text = "ans1"; $arr[1]->text = "ans2"; $arr[2]->text = "ans3"; $nu = array_map(function($e){ return $e->text;},$arr); $str = join(",",$nu); print_r( $str ); print_r($nu);
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
ans1,ans2,ans3Array ( [0] => ans1 [1] => ans2 [2] => ans3 )