I, very hackily, create an object of type stdClass as so:
$arr = array(
'foo' => 'bar',
'baz' => 'bat'
);
$obj = json_decode(json_encode($arr));
How can I now quickly add a third property to $obj without PHP getting angry?
Tips, Expertise, Articles and Advice from the Pro's for Your Website or Blog to Succeed
I, very hackily, create an object of type stdClass as so:
$arr = array(
'foo' => 'bar',
'baz' => 'bat'
);
$obj = json_decode(json_encode($arr));
How can I now quickly add a third property to $obj without PHP getting angry?