Handling properties of an object that have problem characters like colons for example
If a property has a colon in it or another offending character, wrap the property in {" and "}. See example below.
<?php
$myobj = (object) array("property1" => "value1", "property:two" => "value2");
var_dump($myobj);
print($myobj->property1);
print("\n\n");
print($myobj->{"property:two"});
?>
$myobj = (object) array("property1" => "value1", "property:two" => "value2");
var_dump($myobj);
print($myobj->property1);
print("\n\n");
print($myobj->{"property:two"});
?>
[Click to add or edit comments])
Please prepend comments below including a date