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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
32 + 31 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Apr 19 22:01:28 2024 UTC