Bug #75921 [Opn->Csd]: Inconsistent: No warning in some cases when stdObj is created on the fly
| From: | nikic@php.net | Date: | Thu, 14 Feb 2019 11:56:52 +0000 |
| Subject: | Bug #75921 [Opn->Csd]: Inconsistent: No warning in some cases when stdObj is created on the fly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219576@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75921&edit=1
ID: 75921
Updated by: nikic@php.net
Reported by: sp at fp dot de
Summary: Inconsistent: No warning in some cases when stdObj
is created on the fly
-Status: Open
+Status: Closed
Type: Bug
Package: Class/Object related
PHP Version: 7.2.2
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of dave@mudsite.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e63febb1c772e15c1da891f00e3a343090e43c67
Log: Fixed bug #75921
Previous Comments:
------------------------------------------------------------------------
[2018-02-05 17:30:11] sp at fp dot de
Description:
------------
On accessing non-existing properties on an object PHP under some circumstances produces an instance
of stdObj on the fly.
In most cases a warning is produced: "Creating default object from empty value"
The warning is missing, if array-syntax is used:
class test {}
$test = new test();
$test->foo->bar['nope'] = 42;
Test script:
---------------
https://3v4l.org/aakSR
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75921&edit=1