Bug #14221 Updated: Segmentation fault when using class that accesses member functions & variables.

From: Date: Tue, 02 Apr 2002 03:09:04 +0000
Subject: Bug #14221 Updated: Segmentation fault when using class that accesses member functions & variables.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-3787@lists.php.net to get a copy of this message
ID: 14221 Updated by: nickj@nickj.org Reported By: nickj@nickj.org Status: Analyzed Bug Type: Scripting Engine problem Operating System: ANY PHP Version: 4.2.0-dev New Comment: It is related, but that's certainly not immediately clear from the problem description. Effectively what is happening is that there is infinite recursion in my code example given (which causes the segfault). The reason I ever believed that this was valid code was that I incorrectly believed that it was valid to have multiple member functions with the same name, but different parameters. The reason I believed this was because PHP previously happily accepted this - i.e. it allowed a class to have multiple member functions with the same name. In essence, the code is invalid, but PHP's parsing behaviour before would make it very easy to believe that it was valid code. The recent patch (I think it is from Derick) would definitely have prevented me from ever have believing that it was valid code, thus it would have prevented this problem from occurring. It is for this reason that I am quite certain that (assuming the update from #16265 does what it says it does) that this problem is now resolved, and I am also very grateful for everyone's help. Cheers, Nick. Previous Comments: ------------------------------------------------------------------------ [2002-04-01 21:54:13] yohgaki@php.net In fact, this bug is not realated to multiple method definition bug. Stauts => Analyzed. ------------------------------------------------------------------------ [2002-04-01 21:51:50] yohgaki@php.net It seems this isnot related to http://bugs.php.net/bug.php?id=16265 Since this segfaults <?php error_reporting (E_ALL); class test { var $currentField; function setCurrentField($field_name) { $this->currentField = $field_name; } function getValue() { return $this->getValue($this->currentField); } } $frm = new test; $frm->setCurrentField("blah"); print $frm->getValue(); ?> ------------------------------------------------------------------------ [2002-04-01 21:39:36] yohgaki@php.net http://bugs.php.net/bug.php?id=16265 should be reopenned. (I just did) ------------------------------------------------------------------------ [2002-04-01 19:16:29] nickj@nickj.org This looks to have been resolved here: http://bugs.php.net/bug.php?id=16265 If this is correct, can this report be closed? ------------------------------------------------------------------------ [2001-12-06 07:18:42] yohgaki@php.net Make this report a duplicate of #13703 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/14221 -- Edit this bug report at http://bugs.php.net/?id=14221&edit=1

« previous php.bugs (#3787) next »