PHP :: Bug #75921 :: Inconsistent: No warning in some cases when stdObj is created on the fly
php.net |  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: -
Votes:2
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-02-05 17:30 UTC] 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


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Aug 20 22:01:26 2018 UTC