Req #81058 [NEW]: Inedible syntax porridge

From: Date: Thu, 20 May 2021 10:24:52 +0000
Subject: Req #81058 [NEW]: Inedible syntax porridge
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233906@lists.php.net to get a copy of this message
From: zmfw1991 at gmail dot com Operating system: all? PHP version: Irrelevant Package: Compile Warning Bug Type: Feature/Change Request Bug description:Inedible syntax porridge Description: ------------ Semicolon after Control Structures. Versions: php8.0.3, maybe php 5.3 and <5 Test script: --------------- <?php $arr = ['a', 'b', 'c', 'd']; error_reporting(E_ALL); /*---------------------------------------------- example 1 ----------------------------------------------*/ echo "<h1>example 1:</h1>\r\n"; foreach ( $arr as $val ); // Semicolon after foreach! Errors not found! { echo $val . "<br>\r\n"; } /*---------------------------------------------- example 2 ----------------------------------------------*/ echo "<h1>example 2:</h1>\r\n"; function nope() {} foreach ( $arr as $val); nope(); { echo $val . "<br>\r\n"; } /*---------------------------------------------- example 3 ----------------------------------------------*/ echo "<h1>example 3:</h1>\r\n"; if ( false ); { echo 'true'; } /*---------------------------------------------- WHY? ----------------------------------------------*/ echo " <h1>WHY?</h1>\r\n Because <i>foreach</i> and <i>if</i> is Control Structures?<br>\r\n These errors can be searched forever and never found. They are invisible. "; ?> -- Edit bug report at https://bugs.php.net/bug.php?id=81058&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=81058&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=81058&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=81058&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=81058&r=needscript Try newer version: https://bugs.php.net/fix.php?id=81058&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=81058&r=support Expected behavior: https://bugs.php.net/fix.php?id=81058&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=81058&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=81058&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=81058&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=81058&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=81058&r=dst IIS Stability: https://bugs.php.net/fix.php?id=81058&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=81058&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=81058&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=81058&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=81058&r=mysqlcfg

« previous php.bugs (#233906) next »