note 129217 added to language.types.object
| From: | michael at richeyweb dot com | Date: | Fri, 02 Feb 2024 20:54:11 +0000 |
| Subject: | note 129217 added to language.types.object | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221171@lists.php.net to get a copy of this message | ||
The shortest tag you can use to create an object without using new stdClass() (for easy use in a
scalar, or ??) is:(object)[]
php > $o = (object)[];
php > print_r($o);
stdClass Object
(
)
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.157.134 (proxied: 129.222.79.61)
----
Manual Page -- https://php.net/manual/en/language.types.object.php
Edit -- https://main.php.net/note/edit/129217
Del: integrated -- https://main.php.net/note/delete/129217/integrated
Del: useless -- https://main.php.net/note/delete/129217/useless
Del: bad code -- https://main.php.net/note/delete/129217/bad+code
Del: spam -- https://main.php.net/note/delete/129217/spam
Del: non-english -- https://main.php.net/note/delete/129217/non-english
Del: in docs -- https://main.php.net/note/delete/129217/in+docs
Del: other reasons-- https://main.php.net/note/delete/129217
Reject -- https://main.php.net/note/reject/129217
Search -- https://main.php.net/manage/user-notes.php