3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $export = array(); $view = new stdClass(); $view->name = 'first_view'; $view->value = 'first_view_value'; $export[$view->name] = $view; $view = new stdClass(); $view->name = 'second_view'; $view->value = 'second_view_value'; $export[$view->name] = $view; var_dump($export);
based on QYuQm
Output for 5.0.0 - 7.2.0
array(2) { ["first_view"]=> object(stdClass)#1 (2) { ["name"]=> string(10) "first_view" ["value"]=> string(16) "first_view_value" } ["second_view"]=> object(stdClass)#2 (2) { ["name"]=> string(11) "second_view" ["value"]=> string(17) "second_view_value" } }
Output for 4.3.0 - 4.4.9
array(2) { ["first_view"]=> object(stdClass)(2) { ["name"]=> string(10) "first_view" ["value"]=> string(16) "first_view_value" } ["second_view"]=> object(stdClass)(2) { ["name"]=> string(11) "second_view" ["value"]=> string(17) "second_view_value" } }