Trying to use undefined properties in PHP stdClass
objects gives you a "warning" as of PHP 8 (it used to be a "notice" that, being realistic, you ignored).
One way to fix code that looks like the following is to use the new "null coalescing" operator (??
):
For the $b
line, you get these logs in the different versions of PHP:
출처 : https://todayilearned.net/2021/04/php-8-warning-when-trying-use-undefined-stdclass-properties