php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43131 Wrong error message reporting
Submitted: 2007-10-29 18:52 UTC Modified: 2007-11-12 10:07 UTC
From: giovanni at giacobbi dot net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.4.7 OS: Linux
Private report: No CVE-ID: None
 [2007-10-29 18:52 UTC] giovanni at giacobbi dot net
Description:
------------
As you can see from the test case, the reported message is wrong.

The call type is static on class B, while the error reports a dynamic (instance) call on class A, which is misleading for debugging.


Reproduce code:
---------------
<?php

class B {
  function x() {
  }
}

class A {
  function m() {
    B::g();
  }
}

$a = new A();
$a->m();


Expected result:
----------------
Fatal error: Call to undefined static function: b::g() in x.php on line 10

Actual result:
--------------
Fatal error: Call to undefined method: a->g() in x.php on line 10


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-31 16:56 UTC] crescentfreshpot at yahoo dot com
Got the expected result in php 5.2.1: "Fatal error: Call to undefined method B::g() in ..."
 [2007-11-12 10:07 UTC] tony2001@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 30 20:00:02 2025 UTC