#50295 [Opn->Bgs]: no notice on undefined property access
| From: | jani@php.net | Date: | Wed, 25 Nov 2009 17:33:14 +0000 |
| Subject: | #50295 [Opn->Bgs]: no notice on undefined property access | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-145076@lists.php.net to get a copy of this message | ||
ID: 50295
Updated by: jani@php.net
Reported By: ies_clan at hotmail dot com
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
Operating System: Windows XP SP3
PHP Version: 5.3SVN-2009-11-25 (snap)
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2009-11-25 17:00:56] ies_clan at hotmail dot com
Description:
------------
if u try to acccess an property from a class that doesn't exists it
throws a notice, but if u set a value to this property und then u try to
access its ok... but that should ony if there is a __set / __get method
in that class
Reproduce code:
---------------
class test{}
$test = new test();
echo $test->bla;
<-- throws a notice: ok
class test{
public function __set($Key, $Value){...}
public function __get($Key){...}
}
$test = new test();
$test->bla = 'aaa';
echo $test->bla;
<-- throws nothing: ok
class test{}
$test = new test();
$test->bla = 'aaa';
echo $test->bla;
<-- throws nothing: not ok
Expected result:
----------------
first: Notice: Undefined property bla
second:
third: Notice: Undefined property bla
Actual result:
--------------
first: Notice: Undefined property bla
second:
third:
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50295&edit=1