Here is my code:
<?php
$madeUpObject = new \stdClass();
$madeUpObject->madeUpProperty = "abc";
echo $madeUpObject->madeUpProperty;
echo "<br />";
if (property_exists('stdClass', 'madeUpProperty')) {
echo "exists";
} else {
echo "does not exist";
}
?>
And the output is:
abc does not exist
So why does this not work?
stdClass
, but$madeUpObject
? – BullystdClass
– Bully