|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-02-12 05:27 UTC] blizz at c4-coders dot de
<?
class test
{
function getlist($filename,$template)
{
echo $filename.$template."<br>";
}
function getlist($filename)
{
echo $this->getlist($filename,"<default>");
}
}
$temp = new test;
$temp->getlist("test1"); // wrecks
$temp->getlist("test1","test2"); // wrecks
$temp->getlist("test1","test2","test3"); // wrecks
$temp->getlist("test1","test2","test3","test4"); // wrecks
?>
In this case php will cause a general protection fault.
If you comment out this line it works :
echo $this->getlist($filename,"<default>");
So the bug is if you want to access overloaded member methods.
The solution would be to deny function overloading inside and outside classes.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 18:00:01 2025 UTC |
I think he likes to point out, that the military high ranking general protection ('lo illiad ;) fault is a bit harsh when overloding. Throwing an error is more acceptable, but that was reported before, so dublicatifying it.