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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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: Fri Oct 04 08:01:28 2024 UTC