php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34494 overloading function in child class doesn't work
Submitted: 2005-09-13 21:52 UTC Modified: 2005-09-13 23:14 UTC
From: esad dot public at esse dot at Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.5 OS: Linux 2.6.11
Private report: No CVE-ID: None
 [2005-09-13 21:52 UTC] esad dot public at esse dot at
Description:
------------
When I try to overload the function in parent class by just assigning the function argument a default value, the interpreter complains (when running in strict mode)

Reproduce code:
---------------
class Node {
    public function process($param) {
    }
}
       
class Node_FrontController extends Node {
    public function process($param=null) {
    }
}


Expected result:
----------------
No warning message

Actual result:
--------------
Strict Standards: Declaration of Node_FrontController::process() should be compatible with that of Node::process() in FrontController.inc.php on line 25 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-13 23:14 UTC] sniper@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Apr 27 23:01:28 2025 UTC