Edit report at http://bugs.php.net/bug.php?id=52223&edit=1
ID: 52223 Updated by: degeb...@php.net Reported by: webmaster at cephario dot com Summary: switch case shows unexpected behaviour in particular case -Status: Open +Status: Bogus Type: Bug Package: Unknown/Other Function Operating System: Win32Server2003SE PHP Version: 5.3.2 New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. 0 == 'N', so the case passes. Previous Comments: ------------------------------------------------------------------------ [2010-07-01 16:01:54] webmaster at cephario dot com Description: ------------ if the given value is a numeric 0 (AND YES APPLIES ONLY FOR THE 0 negative or positive int values are working as expected) the first string expression (case) is matched. Test script: --------------- <pre><?php $data = 0; echo $data."\n\n"; switch ($data) { case 1: $data = 'UNA'; break; case 'N': $data = 'NOW()'; break; case 'NOWB()': $data = 'NOWB()'; break; default: $data = 'DATANEW'; } echo $data; ?></pre> Expected result: ---------------- DATANEW Actual result: -------------- NOW() ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52223&edit=1