Convert array to stdobject

To convert your PHP array to an StdObject (that is, an instance of the StdClass), do the following:

$my_array = new array(
"x" => "y",
"z" => 0
);

$my_stdobject = (object) $my_array;

Or, to initiate an StdObject in short-hand:

$my_stdobject = (object) array(
"x" => "y",
"z" => 0
);