Req #60625 [NEW]: Emit notice for NOP statement

From: Date: Thu, 29 Dec 2011 19:22:33 +0000
Subject: Req #60625 [NEW]: Emit notice for NOP statement
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-166137@lists.php.net to get a copy of this message
From:             
Operating system: N/A
PHP version:      Irrelevant
Package:          Scripting Engine problem
Bug Type:         Feature/Change Request
Bug description:Emit notice for NOP statement

Description:
------------
As a matter of convenience for PHP programmers, would it be possible to
somehow 
detect NOP-type statements (see example below) and create a new notice to
notify 
the programmer of their presence?

When writing embedded code, NOP statements are often handy (or even
required). 
However, in something as high-level as PHP, I can't see any situation where
one 
would need such statements. Thus, whenever they DO occur it's most likely
by 
accident (again see example below).

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

"This string was meant to be sent as output, but I forgot to echo it!";
1+1;
$variable;

?>

Expected result:
----------------
Notice: Statement has no effect in (path) on line 3

Notice: Statement has no effect in (path) on line 4

Notice: Statement has no effect in (path) on line 5


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



Thread (4 messages)

« previous php.bugs (#166137) next »