ID:               49348
 User updated by:  BelStudent at yandex dot ru
 Reported By:      BelStudent at yandex dot ru
-Status:           Verified
+Status:           Bogus
 Bug Type:         Scripting Engine problem
-Operating System: *
+Operating System: Windows XP SP3
 PHP Version:      5.3.0
 New Comment:

That was a bug in php 4, I thought in php 5 you completely remade class
system.
You can not throw an error, but the notice must also be discarded. 
We, however, when doing simple ++$num receiving notice:
<?php
++$num;
?>


Previous Comments:
------------------------------------------------------------------------

[2009-08-25 07:13:46] gwy...@php.net

Actually, this is a valid problem; the problem described by bug #21008
is a different issue. There seems to be some confusion as to whether it
should be fixed or not, but it's neither a duplicate nor bogus.

Specifically, bug #21008 describes an issue with setting a variable to
a value, where this report describes an issue with updating a variable.
These are two distinct operations, and are handled differently.

More to the point, the following code throws a notice:
<?php
++$n;
?>

That the code described by this bug doesn't is an inconsistency.

------------------------------------------------------------------------

[2009-08-25 06:56:33] j...@php.net

Thank you for not searching before submitting another bogus report. See
bug #21008 for one explanation..

------------------------------------------------------------------------

[2009-08-24 16:21:58] BelStudent at yandex dot ru

Description:
------------
Usually, if you try to do this: ++$num, then thrown notice, that the
"Undefined variable: num". This helps avoid errors. 
But if you have class and you're trying to do so ++$this->num num
nowhere and had not previously identified, then the issue no warnings
and notices. 

Accidentally deleted in the symbol and received ++$this->nu, and then
climbed into hell knows what mistakes to find this place and correct to
++$this->num took several hours. So I am very concerned about the issue:
how to do so were given notice, if you try to do something with
uninitialized (unknown) variable in the class?

Reproduce code:
---------------
<?php
class A
{ public function __construct()
    {   ++$this->num;
    }
}
new A();
?>

Expected result:
----------------
Undefined property:  A::$num


Actual result:
--------------
empty


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49348&edit=1

Reply via email to