Edit report at https://bugs.php.net/bug.php?id=40248&edit=1

 ID:                 40248
 Comment by:         php dot net at doppy dot nl
 Reported by:        jontsa at amigaone dot cc
 Summary:            Undefined members with combined operators produce no
                     warning
 Status:             Open
 Type:               Feature/Change Request
 Package:            Scripting Engine problem
 Operating System:   Solaris
 PHP Version:        5.2.0
 Block user comment: N
 Private report:     N

 New Comment:

Can still reproduce this.

--------------------
PHP 5.3.10-1ubuntu2 with Suhosin-Patch (cli) (built: Mar  5 2012 18:27:21) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
--------------------


Recommend using this reproduce code:
--------------------
<?php
error_reporting(-1);
$a+=5;

$b=new stdClass;
$b->a+=5;

$b=new stdClass;
$b->a=$b->a + 5;
--------------------

Expected result:
--------------------
PHP Notice:  Undefined variable: a in /test.php on line 3
PHP Notice:  Undefined property: stdClass::$a in /test.php on line 6
PHP Notice:  Undefined property: stdClass::$a in /test.php on line 9
--------------------

Actual result:
--------------------
PHP Notice:  Undefined variable: a in /test.php on line 3
PHP Notice:  Undefined property: stdClass::$a in /test.php on line 9
--------------------


Previous Comments:
------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=40248&edit=1

Reply via email to