ID: 28727
Updated by: [EMAIL PROTECTED]
Reported By: vvkrougl at mail dot ru
-Status: Open
+Status: Bogus
Bug Type: Compile Failure
Operating System: FreeBSD
PHP Version: 4.3.4
New Comment:
break is language construct and cannot be used in such expressions just
becase PHP can't compute the value of such expression.
On the other hand, die() is just a function, which returns a result
value.
couple of example:
if ($foo == $var || break) //wrong. break returns nothing and PHP
cannot compute expression's value.
if ($foo == $var || echo) //wrong. echo returns nothing
if ($foo == $var || strlen('some')) // ok
$foo == 1 OR echo 1; //wrong
$foo == 1 OR print 1; //correct. print() always return true.
Previous Comments:
------------------------------------------------------------------------
[2004-06-10 14:04:44] vvkrougl at mail dot ru
Description:
------------
This script isn't work at all! IE display this line:"Parse error: parse
error in /s.php on line 3". If I change the 'break' staement to
'die("Something...")' then everything work fine!
Reproduce code:
---------------
<?
do {
$a = 1 or break;
} while (0);
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28727&edit=1