#28111 [Opn->Fbk]: switch($this->type = $type) cause SEGV

From: Date: Fri, 23 Apr 2004 07:04:18 +0000
Subject: #28111 [Opn->Fbk]: switch($this->type = $type) cause SEGV
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58620@lists.php.net to get a copy of this message
ID: 28111 Updated by: derick@php.net Reported By: derrell dot lipman at unwireduniverse dot com -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: Linux 2.4 PHP Version: 5.0.0RC1 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2004-04-22 22:21:32] derrell dot lipman at unwireduniverse dot com Description: ------------ An assignment (of a class variable?) in a switch statement causes an apache crash. The first object instantiation int eh attached sample ($testval == 1) succeeds; the second one ($testval == 2) fails. Reproduce code: --------------- <?php class TestClass { var $type; function TestClass($testval) { $type = intval("2"); if ($testval == 1) { switch($type) { default: echo "Test 1 worked<br>"; flush(); break; } } else if ($testval == 2) { switch($this->type = $type) /* This line causes crash */ { default: echo "Test 2 worked<br>"; flush(); break; } } } } $tc = new TestClass(1); $tc = new TestClass(2); ?> Actual result: -------------- In apache/error.log: [notice] child pid XXXXX exit signal Segmentation fault (11) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28111&edit=1

« previous php.bugs (#58620) next »