php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15518 PHP wrecks on using overloaded functions inside one of them
Submitted: 2002-02-12 05:27 UTC Modified: 2002-06-18 19:25 UTC
From: blizz at c4-coders dot de Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.1.1 OS: Windows 2000 Advanced Server SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: blizz at c4-coders dot de
New email:
PHP Version: OS:

 

 [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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-12 06:33 UTC] volkard at normannia dot de
Sorry, no overloading in php, I'm afraid.
 [2002-02-12 06:38 UTC] jan@php.net
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.
 [2002-02-13 05:36 UTC] blizz at c4-coders dot de
general protection fault..
well 1) kill this bug, its another fault which is already in the database
2) about gpf: php.exe just terminates with a ugly accessfault error
 [2002-06-18 19:25 UTC] sniper@php.net
Killed. :)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 09:01:32 2024 UTC