ID:               43846
 Updated by:       [EMAIL PROTECTED]
 Reported By:      php_bug at jldupont dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Linux
 PHP Version:      5.2.5
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.


Previous Comments:
------------------------------------------------------------------------

[2008-01-14 21:21:36] php_bug at jldupont dot com

Description:
------------
The 'switch' statement does not correctly handle the case where the
switch value === null.


Reproduce code:
---------------
The following code should show "null", "true", "false":

 function testSwitch( $v )
 {
  return $v;
 }

 function showResult( $r )
 {
  $v = testSwitch( $r );

  switch ($v)
  {
   case false:
    echo "false";
    break;
   case null:
    echo "null";
    break;
   case true:
    echo "true";
    break;
  }
   echo "\n<br/>";
 }

 showResult( null );
 showResult( true );
 showResult( false );


Expected result:
----------------
null
true
false


Actual result:
--------------
false
true
false



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43846&edit=1

Reply via email to