From: derrell dot lipman at unwireduniverse dot com Operating system: Linux 2.4 PHP version: 5.0.0RC1 PHP Bug Type: Reproducible crash Bug description: switch($this->type = $type) cause SEGV
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 bug report at http://bugs.php.net/?id=28111&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28111&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28111&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28111&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28111&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28111&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28111&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28111&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28111&r=support Expected behavior: http://bugs.php.net/fix.php?id=28111&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28111&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28111&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28111&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28111&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28111&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28111&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28111&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28111&r=float