#38716 [Opn->Bgs]: Fatal error: Cannot access private property
| From: | tony2001@php.net | Date: | Mon, 04 Sep 2006 20:17:40 +0000 |
| Subject: | #38716 [Opn->Bgs]: Fatal error: Cannot access private property | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-101731@lists.php.net to get a copy of this message | ||
ID: 38716
Updated by: tony2001@php.net
Reported By: mmerlone at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
Operating System: Ubuntu linux 6.06 2.6.15-26-686
PHP Version: 5.1.6
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:
------------------------------------------------------------------------
[2006-09-04 20:08:51] mmerlone at gmail dot com
Description:
------------
Overloading method __set does not work for private variables as the
example "Example 19-20. overloading with __get, __set, __isset and
__unset example" from
http://us3.php.net/manual/en/language.oop5.overloading.php
.
This is the same of bug #34893 (http://bugs.php.net/bug.php?id=34893)
which claims to be fixed, but is not.
Reproduce code:
---------------
<?
class bla{
private $variavel;
function bla(){
}
function __set($vn, $vv){
$this->$vn = $vv;
}
}
$bla = new bla();
$bla->variavel = 1;
echo "bla->variavel=".$bla->variavel."\n";
?>
Expected result:
----------------
bla->variavel=1
Actual result:
--------------
Fatal error: Cannot access private property bla::$variavel in
/devel/testes/private.php on line 14
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38716&edit=1