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: 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
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

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-02-14 11:56 UTC] nikic@php.net
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
 [2019-02-14 11:56 UTC] nikic@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 06 01:01:27 2024 UTC