php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52095 Subclassing a class in a namespace doesn’t allow overloading functions
Submitted: 2010-06-16 15:16 UTC Modified: 2013-02-18 00:34 UTC
From: samu dot voutilainen at gmail dot com Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5.3.2 OS: Linux
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
19 - 17 = ?
Subscribe to this entry?

 
 [2010-06-16 15:16 UTC] samu dot voutilainen at gmail dot com
Description:
------------
Code below demonstrates how to produce the bug.

I get to error log a very obscure error:

[Wed Jun 16 15:50:26 2010] [error] [client 127.0.0.1] PHP Fatal error:  Class 'slm\\util\\Logger' not found in [..]/a.php on line 160

As a note, there is no call to Logger in this class. 

Test script:
---------------
namespace foo {
class A {
 public function meh($is = true) { }
}
}
namespace bar {
class B extends /foo/A {
 public function meh() {}
}
}

Expected result:
----------------
B::meh() to override A::meh()

Actual result:
--------------
No output and very strange error to the system log:

[Wed Jun 16 15:50:26 2010] [error] [client 127.0.0.1] PHP Fatal error:  Class 'slm\\util\\Logger' not found in [..]/a.php on line 160

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-17 02:03 UTC] felipe@php.net
-Status: Open +Status: Feedback
 [2010-06-17 02:03 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

I just got this message:
Strict Standards: Declaration of bar\B::meh() should be compatible with that of foo\A::meh()
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 23:01:30 2024 UTC