<?php $image_path = array('sm'=>'sm','lg'=>'lg','secondary'=>array('whatever')); $obj = (object)$image_path; var_dump($obj);
Standard input is empty
object(stdClass)#1 (3) { ["sm"]=> string(2) "sm" ["lg"]=> string(2) "lg" ["secondary"]=> array(1) { [0]=> string(8) "whatever" } }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!