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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Sun Dec 22 03:01:28 2024 UTC