note 128108 added to class.stdclass
| From: | MatsM at main dot php dot net | Date: | Fri, 13 Jan 2023 07:52:52 +0000 |
| Subject: | note 128108 added to class.stdclass | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220062@lists.php.net to get a copy of this message | ||
In PHP8 this has been changed
https://www.php.net/manual/en/migration80.incompatible.php
A number of warnings have been converted into Error exceptions:
Attempting to write to a property of a non-object. Previously this implicitly created an stdClass
object for null, false and empty strings.
So if you add properties to a $var, you first need to make it a stdClass()
$var = new stdClass();
$var->propp1 = "nice";
$var->propp2 = 1234;
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.158.213 (proxied: 136.163.203.3)
----
Manual Page -- https://php.net/manual/en/class.stdclass.php
Edit -- https://main.php.net/note/edit/128108
Del: integrated -- https://main.php.net/note/delete/128108/integrated
Del: useless -- https://main.php.net/note/delete/128108/useless
Del: bad code -- https://main.php.net/note/delete/128108/bad+code
Del: spam -- https://main.php.net/note/delete/128108/spam
Del: non-english -- https://main.php.net/note/delete/128108/non-english
Del: in docs -- https://main.php.net/note/delete/128108/in+docs
Del: other reasons-- https://main.php.net/note/delete/128108
Reject -- https://main.php.net/note/reject/128108
Search -- https://main.php.net/manage/user-notes.php