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:
 [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-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 03:01:55 2014 UTC