php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #28835 cannot call overloaded methods via parent::method() or self::method()
Submitted: 2004-06-18 18:44 UTC Modified: 2014-11-01 22:48 UTC
Votes:6
Avg. Score:5.0 ± 0.0
Reproduced:6 of 6 (100.0%)
Same Version:2 (33.3%)
Same OS:1 (16.7%)
From: david dot seidel at one-jinx dot de Assigned: requinix (profile)
Status: Closed Package: *General Issues
PHP Version: 5.0.0RC3 OS: SuSE Linux 2.4.19-4GB
Private report: No CVE-ID: None
 [2004-06-18 18:44 UTC] david dot seidel at one-jinx dot de
Description:
------------
I would like to call overloaded methods via the magic function __call($methodName, $params), but this fail in context with parent or self. 

Reproduce code:
---------------
<?PHP
class Test {
	public function __call($methodName, $args) {
		print "Hello World";
	}
}

class Test2 extends Test {
	public function testMe() {
		parent::setName();
	}	
}

$test = new Test2();
$test->testMe();
?>

Expected result:
----------------
ouput: Hello World

Actual result:
--------------
Fatal error: Call to undefined method Test::testmealso() in /srv/www/htdocs/bluewonder_neo/bluewonder/tests/david_test.php on line 4

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-01 22:48 UTC] requinix@php.net
-Status: Open +Status: Closed -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: requinix
 [2014-11-01 22:48 UTC] requinix@php.net
Duplicated as bug #42937 which was fixed in 5.2.6.
http://3v4l.org/HPRX0
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 08:01:29 2024 UTC