Bug #15518 Updated: PHP wrecks on using overloaded functions inside one of them

From: Date: Wed, 13 Feb 2002 10:36:41 +0000
Subject: Bug #15518 Updated: PHP wrecks on using overloaded functions inside one of them
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229@lists.php.net to get a copy of this message
ID: 15518 Updated by: blizz@c4-coders.de Reported By: blizz@c4-coders.de Status: Duplicate Bug Type: Reproducible crash Operating System: Windows 2000 Advanced Server SP2 PHP Version: 4.1.1 New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2002-02-12 06:38:18] 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-12 06:33:34] volkard@normannia.de Sorry, no overloading in php, I'm afraid. ------------------------------------------------------------------------ [2002-02-12 05:27:59] blizz@c4-coders.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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15518&edit=1

« previous php.bugs (#229) next »