Req #81231 [NEW]: improve or add short method for creating objects, it was done with arrays.
| From: | icarosnet at gmail dot com | Date: | Wed, 07 Jul 2021 19:13:29 +0000 |
| Subject: | Req #81231 [NEW]: improve or add short method for creating objects, it was done with arrays. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-234883@lists.php.net to get a copy of this message | ||
From: icarosnet at gmail dot com
Operating system: Ubuntu 20.04
PHP version: 8.1.0alpha2
Package: Unknown/Other Function
Bug Type: Feature/Change Request
Bug description:improve or add short method for creating objects, it was done with arrays.
Description:
------------
improve or add short method for creating objects, it was done with
arrays.
Test script:
---------------
The only two ways to create an object in PHP are:
$obj = new stdclass ();
$obj = (object) Array(); // the same as $ obj = (object)[];
or am I wrong?
why objects don't have a short initialization method:
$obj = Object(); // avoiding the use of new stdclass ();
$obj = {};
similar to how an array is created
$arr = Array();
$arr = [];
Actual result:
--------------
Error
--
Edit bug report at https://bugs.php.net/bug.php?id=81231&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81231&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81231&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81231&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81231&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81231&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81231&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81231&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81231&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81231&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81231&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81231&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81231&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81231&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81231&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81231&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81231&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81231&r=mysqlcfg