php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35347 missing E_STRICT when calling static methods from class
Submitted: 2005-11-23 11:23 UTC Modified: 2005-11-23 14:46 UTC
From: bjori@php.net Assigned: dmitry (profile)
Status: Not a bug Package: Class/Object related
PHP Version: 5.1.0RC6 OS:
Private report: No CVE-ID: None
 [2005-11-23 11:23 UTC] bjori@php.net
Description:
------------
Missing E_STRICT when calling non-static method from class method

Reproduce code:
---------------
<?php
    class foo {
        function bar() {
            print "foo::bar()\n";
        }
    }

    class bar {
        function __construct() {
            foo::bar();
        }
    }

    new bar;
    foo::bar();
?>

Expected result:
----------------
Strict Standards: Non-static method foo::bar() should not be called statically in ..
foo::bar()

Strict Standards: Non-static method foo::bar() should not be called statically in ..
foo::bar() 

Actual result:
--------------
foo::bar()

Strict Standards: Non-static method foo::bar() should not be called statically in ...
foo::bar() 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-23 13:54 UTC] tony2001@php.net
Dmitry, please check it out.
 [2005-11-23 14:46 UTC] dmitry@php.net
This is not a bug.

bar::foo() in __construct() does call bar() as normal (non-static) method. In the same way as self::bar() or $this->bar() do.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 22:01:28 2024 UTC