|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75921 Inconsistent: No warning in some cases when stdObj is created on the fly
Submitted: 2018-02-05 17:30 UTC Modified: -
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: sp at fp dot de Assigned:
Status: Closed Package: Class/Object related
PHP Version: 7.2.2 OS:
Private report: No CVE-ID: None
 [2018-02-05 17:30 UTC] sp at fp dot de
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:


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-02-14 11:56 UTC]
Automatic comment on behalf of
Log: Fixed bug #75921
 [2019-02-14 11:56 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Sep 28 12:05:52 2022 UTC