PHP 4.0 Bug #5879 Updated: switch() malfunction under very specific conditions

From: Date: Fri, 04 Aug 2000 09:36:30 +0000
Subject: PHP 4.0 Bug #5879 Updated: switch() malfunction under very specific conditions
Groups: php.dev 
Request: Send a blank email to php-dev+get-27637@lists.php.net to get a copy of this message
ID: 5879 Updated by: jalal Reported By: dragonzap1@aol.com Status: Analyzed Bug Type: Scripting Engine problem Assigned To: Comments: Definitely something strange going on with this one. The following code works correctly on the first iteration, then incorrectly, and will throw a segfault after about 6-7 reloads. Both WinNT and Linux platforms. <?php switch("1"){ default: echo 'NOT '; break; } echo 'a problem.'; exit; someFunction(NULL); $ec = new EmptyClass(); $ec->someOtherMethod(); $somevar = $ec->someMethod(NULL); ?> Comment out any of the last four lines, and the code functions as expected. Add a case "0": statement and the code functions correctly. Any ideas anyone? (Yes, I realize the code is not realistic, but it does indicate some error in the parsing of it.) Full Bug description available at: http://bugs.php.net/?id=5879

« previous php.dev (#27637) next »