php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43884 Object model
Submitted: 2008-01-17 21:16 UTC Modified: 2008-01-28 23:33 UTC
From: vbaryshev at list dot ru Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 6CVS-2008-01-17 (snap) OS: Windows XP
Private report: No CVE-ID: None
 [2008-01-17 21:16 UTC] vbaryshev at list dot ru
Description:
------------
Sory. I very bad speek english. ???????? ????????????? ????????? __CLASS__.

Reproduce code:
---------------
class Test1 {
    public function __construct() { }
    public function foo()
    {
        echo __CLASS__ . '<br />';
    }
}
class Test2 extends Test1 {
    public function __construct() { }
}
$obj1 = new Test1();
$obj2 = new Test2();
$obj1->foo();
$obj2->foo();


Expected result:
----------------
Test1<br />
Test1<br />

Actual result:
--------------
I think, that result must be:
Test1<br />
Test2<br />

????? Test2() ????????? ?????? ?????? Test1() ? ????? foo() ??? ?????? ?? ??????? obj2 ?????? ???? ?????? ??? ????? ?????? Test2() IMHO

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-28 23:33 UTC] tony2001@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

Constants like __FILE__, __LINE__, __CLASS__ and alike ar resolved in compile time.
Please read the docs before reporting.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 17 10:00:01 2025 UTC