#49348 [NEW]: no notice
From: BelStudent at yandex dot ru
Operating system: Windows XP SP3
PHP version: 5.3.0
PHP Bug Type: Unknown/Other Function
Bug description: no notice
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 bug report at http://bugs.php.net/?id=49348&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49348&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49348&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49348&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49348&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49348&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49348&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49348&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49348&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49348&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49348&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49348&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49348&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49348&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49348&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49348&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49348&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49348&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49348&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49348&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49348&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49348&r=mysqlcfg
Thread (14 messages)
- BelStudent at yandex dot ru
- jani@php.net#49348 [Opn->Bgs]: no notice
- gwynne@php.net#49348 [Bgs->Ver]: no notice
- BelStudent at yandex dot ru#49348 [Ver->Bgs]: no notice
- jani@php.net#49348 [Bgs->Opn]: no notice
- jani@php.net#49348 [Opn]: Uninitialized ++$foo->bar; does not cause a notice (but ++$bar; does!)
- sjoerd@php.net#49348 [Opn->Ver]: Uninitialized ++$foo->bar; does not cause a notice (but ++$bar; does!)
- jani@php.net#49348 [Ver->Asn]: Uninitialized ++$foo->bar; does not cause a notice (but ++$bar; does!)
- sjoerd@php.net#49348 [Asn]: Uninitialized ++$foo->bar; does not cause a notice (but ++$bar; does!)
- stas@php.netBug #49348 [Asn]: Uninitialized ++$foo->bar; does not cause a notice (but ++$bar; does!)
- stas@php.netBug #49348 [Asn]: Uninitialized ++$foo->bar; does not cause a notice (but ++$bar; does!)
- dmitry@php.netBug #49348 [Asn]: Uninitialized ++$foo->bar; does not cause a notice (but ++$bar; does!)
- stas@php.netBug #49348 [Asn->Csd]: Uninitialized ++$foo->bar; does not cause a notice (but ++$bar; does!)
- bugs dot php dot net at majkl578 dot czBug #49348 [Com]: Uninitialized ++$foo->bar; does not cause a notice (but ++$bar; does!)