php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42852 Inconsistent message when creating default object from empty value
Submitted: 2007-10-04 09:50 UTC Modified: 2008-02-28 19:34 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: robin_fernandes at uk dot ibm dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 5CVS-2007-10-04 (snap) OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: robin_fernandes at uk dot ibm dot com
New email:
PHP Version: OS:

 

 [2007-10-04 09:50 UTC] robin_fernandes at uk dot ibm dot com
Description:
------------
This is a minor inconsistency in error reporting. When a stdClass instance is implicitly created, in some cases an E_STRICT is emitted but in other cases not.

Reproduce code:
---------------
<?php
echo "\nAbout to create a default object from empty value:\n";
$obj1->p = 1;
echo "\nAbout to create a default object from empty value again:\n";
$obj2->p[] = 1;
echo "\nAbout to create a default object from empty value one more time:\n";
$a = 1;
$obj3->p = &$a;
?>

Expected result:
----------------
About to create a default object from empty value:

Strict Standards: Creating default object from empty value in %s on line 3

About to create a default object from empty value again:

Strict Standards: Creating default object from empty value in %s on line 5

About to create a default object from empty value one more time:

Strict Standards: Creating default object from empty value in %s on line 8

Actual result:
--------------
About to create a default object from empty value:

Strict Standards: Creating default object from empty value in %s on line 3

About to create a default object from empty value again:

About to create a default object from empty value one more time:


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-28 19:34 UTC] felipe@php.net
Commited in HEAD.

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC