#40248 [Opn]: Undefined members with combined operators produce no warning
| From: | vrana@php.net | Date: | Fri, 17 Aug 2007 16:05:48 +0000 |
| Subject: | #40248 [Opn]: Undefined members with combined operators produce no warning | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-116252@lists.php.net to get a copy of this message | ||
ID: 40248
Updated by: vrana@php.net
Reported By: jontsa at amigaone dot cc
Status: Open
-Bug Type: Documentation problem
+Bug Type: Class/Object related
Operating System: Solaris
PHP Version: 5.2.0
New Comment:
If this incostitent and possibly-errors-hiding behavior should be
documented as a feature it should be explained why PHP behaves this
way.
Please write down the reasons why this is the correct behavior. I
provided two reasons why this is more bug than a feature.
Previous Comments:
------------------------------------------------------------------------
[2007-08-17 13:37:23] jani@php.net
Because it is.
------------------------------------------------------------------------
[2007-08-17 11:09:21] vrana@php.net
Why this form of usage of undefined property should be considered as
feature?
------------------------------------------------------------------------
[2007-05-10 20:40:29] sniper@php.net
This is actually a feature. Can't seem to find where it's documented
though so reclassifying.
------------------------------------------------------------------------
[2007-01-26 10:12:51] jontsa at amigaone dot cc
Description:
------------
When using a combined operator like += or ++ on an undefined class
member, it does not produce "undefined property" notice as expected.
Tested with all errors enabled.
Reproduce code:
---------------
$a+=5;
$b=new stdClass;
$b->a+=5;
Expected result:
----------------
Notice: Undefined variable: a
Notice: Undefined property: stdClass::$a
Actual result:
--------------
Notice: Undefined variable: a
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40248&edit=1