#51047 [NEW]: keyword "continue": argument type-check would be safer
| From: | matze73 at hallo dot ms | Date: | Sun, 14 Feb 2010 17:19:28 +0000 |
| Subject: | #51047 [NEW]: keyword "continue": argument type-check would be safer | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-147613@lists.php.net to get a copy of this message | ||
From: matze73 at hallo dot ms
Operating system: any
PHP version: 5.2.12
PHP Bug Type: Feature/Change Request
Bug description: keyword "continue": argument type-check would be safer
Description:
------------
The 'continue' keyword can have a numerical argument which is not
type-checked.
Php could do a type-check on the argument that would catch (some) syntax
errors where the ";" is missing after 'continue'.
Please consider the syntax error of a missing ";" after 'continue'.
The reproduce-code "eats" the following line during runtime.
Reproduce code:
---------------
if ( condition )
continue // missing ; here
$a = "test";
Expected result:
----------------
The line
$a = "test"
is expected to be executed if condition is false.
Actual result:
--------------
The line
$a = "test"
is only executed if 'condition' is true.
No warning during run-time although continue's argument-type is incorrect.
--
Edit bug report at http://bugs.php.net/?id=51047&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51047&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51047&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51047&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51047&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51047&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51047&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51047&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51047&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51047&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51047&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51047&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51047&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51047&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51047&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51047&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51047&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51047&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51047&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51047&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51047&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51047&r=mysqlcfg