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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bjori@php.net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Wed Nov 13 09:01:29 2024 UTC