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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
44 - 40 = ?
Subscribe to this entry?

 
 [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: Thu Apr 18 07:01:27 2024 UTC