Bug #52643 [NEW]: No error/warning for data after missing semicolon after break statement

From: Date: Thu, 19 Aug 2010 08:42:03 +0000
Subject: Bug #52643 [NEW]: No error/warning for data after missing semicolon after break statement
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-153602@lists.php.net to get a copy of this message
From:             
Operating system: Linux
PHP version:      5.2.14
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:No error/warning for data after missing semicolon after break statement

Description:
------------
If you forget the semicolon after a 'break' statement. Almost all
characters up to the next ; is ignored. Hence you won't get a error message
about the problem.

For example, if you set a variable immediately after a mistake like this.
You might be wondering for a long time of why the variable is not set.

Test script:
---------------
<?

if (0)
 break

$variable1 = 'hey';
$variable2 = 'ho';

print "Variable1 = $variable1\n";
print "Variable2 = $variable2\n";

?>

Expected result:
----------------
Error message

Actual result:
--------------
Variable1 = 
Variable2 = ho

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52643&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=52643&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=52643&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=52643&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=52643&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52643&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=52643&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=52643&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=52643&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=52643&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=52643&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=52643&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=52643&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=52643&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=52643&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52643&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52643&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=52643&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=52643&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=52643&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=52643&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=52643&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#153602) next »