From: jon at latchkey dot com Operating system: OSX PHP version: 5.0.0 PHP Bug Type: Output Control Bug description: not getting the expected output i think i should get
Description: ------------ [6][ /private/tmp ]% cat test2.php <? function doA() { return true; } function doB() { return true; } ?> <? if (doA()) { ?>here1<? } else ?> <? if (doB()) { ?>here2<? } ?> <? if (doA()) { ?>here3<? ?> <? } else if (doB()) { ?>here4<? } ?> [7][ /private/tmp ]% php --version PHP 5.0.0 (cli) (built: Aug 3 2004 15:10:22) Copyright (c) 1997-2004 The PHP Group Zend Engine v2.0.0, Copyright (c) 1998-2004 Zend Technologies [8][ /private/tmp ]% php test2.php here1here2 here3 [9][ /private/tmp ]% Reproduce code: --------------- <? function doA() { return true; } function doB() { return true; } ?> <? if (doA()) { ?>here1<? } else ?> <? if (doB()) { ?>here2<? } ?> <? if (doA()) { ?>here3<? ?> <? } else if (doB()) { ?>here4<? } ?> Expected result: ---------------- here1here2 here3here4 (or a compile error) Actual result: -------------- here1here2 here3 -- Edit bug report at http://bugs.php.net/?id=30054&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30054&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30054&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30054&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30054&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30054&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30054&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30054&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30054&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30054&r=support Expected behavior: http://bugs.php.net/fix.php?id=30054&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30054&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30054&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30054&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30054&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30054&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30054&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30054&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30054&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30054&r=mysqlcfg