这是我的代码:
<?php
$madeUpObject = new \stdClass();
$madeUpObject->madeUpProperty = "abc";
echo $madeUpObject->madeUpProperty;
echo "<br />";
if (property_exists('stdClass', 'madeUpProperty')) {
echo "exists";
} else {
echo "does not exist";
}
?>
输出是:
abc 不存在
那么为什么这不起作用呢?