ID:               35587
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jte at dontsteel dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Windows XP
 PHP Version:      5.1.1
 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

You cannot do return $c or die; 


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

[2005-12-07 18:42:00] jte at dontsteel dot com

Description:
------------
It appears that when 'or die' is used in combination with a return
statement the return will always be 1, instead of returning the proper
value and dying when not able to return the value. This appears to
happen with any data type being returned.

Reproduce code:
---------------
function Sum($a, $b) {
        $c = $a + $b;
        return $c or die;
}

echo Sum(1,1);

Expected result:
----------------
6

Actual result:
--------------
1


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


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

Reply via email to