ID:               43885
 Updated by:       [EMAIL PROTECTED]
 Reported By:      vbaryshev at list dot ru
-Status:           Open
+Status:           Bogus
 Bug Type:         *General Issues
 Operating System: Windows XP
 PHP Version:      6CVS-2008-01-17 (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

http://www.php.net/manual/en/language.oop5.overloading.php


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

[2008-01-17 21:34:38] vbaryshev at list dot ru

Description:
------------
Some bugs with __get(), __set()

Reproduce code:
---------------
class Test1
{
    public function __construct() { }
    public function test()
    {
        $this->Prop = 'test';
        echo $this->Prop;
        echo isset($this->Prop);
        echo !empty($this->Prop);
        echo $this->Prop;
    }
}
class Test2 extends Test1
{
    private $prop;
    public function __construct() { }
    public function __get($name)
    {
        $name{0} = strtolower($name{0}); // Property called with first
symbol upper case
        switch ($name)
        {
            case "prop" :
                return $this->prop;
                break;
        }
    }
    public function __set($name, $value)
    {
        $name{0} = strtolower($name{0}); // Property called with first
symbol upper case
        switch ($name)
        {
            case "prop" :
                $this->prop = $value;
                break;
        }
    }
}
$obj = new Test2();
$obj->test();


Expected result:
----------------
test
{false}
{false}
test

Actual result:
--------------
test
1
1
test

Íàëè÷èå ñâîéñòâ íå ðàñïîçíàþòñÿ ñòàíäàðòíûìè ôóíêöèÿìè, ÷òî ÿâëÿåòñÿ
íåâåðíûì ñ ëîãè÷åñêîé òî÷êè çðåíèÿ è çàòðóäíÿåò ïðîâîäèòü íåêîòîðûå
ïðîâåðêè ñ ïðàêòè÷åñêîé òî÷êè çðåíèÿ.
Sory, my english very bad :(


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


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

Reply via email to