php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50295 no notice on undefined property access
Submitted: 2009-11-25 17:00 UTC Modified: 2009-11-25 17:33 UTC
From: ies_clan at hotmail dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.3SVN-2009-11-25 (snap) OS: Windows XP SP3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ies_clan at hotmail dot com
New email:
PHP Version: OS:

 

 [2009-11-25 17:00 UTC] 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:

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-25 17:33 UTC] jani@php.net
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


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 03:01:29 2024 UTC