|  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: Open Package: Class/Object related
PHP Version: 7.2.2 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: sp at fp dot de
New email:
PHP Version: OS:


 [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

PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Dec 17 04:01:25 2018 UTC