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

 ID:                 40248
 Updated by:         re...@php.net
 Reported by:        jontsa at amigaone dot cc
 Summary:            Undefined members with combined operators produce no
                     warning
-Status:             Open
+Status:             Closed
 Type:               Feature/Change Request
 Package:            Scripting Engine problem
 Operating System:   Solaris
 PHP Version:        5.2.0
-Assigned To:        
+Assigned To:        reeze
 Block user comment: N
 Private report:     N

 New Comment:

The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

This was implemented in lastest version 5.5 master


Previous Comments:
------------------------------------------------------------------------
[2012-03-20 21:00:46] php dot net at doppy dot nl

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
--------------------

------------------------------------------------------------------------
[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