From: sascha dot wildgrube at steganos dot com
Operating system: all
PHP version: 4.3.2
PHP Bug Type: *Programming Data Structures
Bug description: using unreferenced variables does not produce errors

Description:
------------
Any variable identifier can be used in a statement - even if it hasn't
been referenced before - without producing an error.

Most of the time when debuggong php code is spent for searching typos in
variable names.

I consider it a bug that php does not produce and display error if it
encounters an unreferenced variable in a statement.

A solution could be a "strict" statement. That tells php to throw errors
in that case to stay backward compatible.

An even better solution would be the need to

Reproduce code:
---------------
$nValue1 = 10;
$nValue2 = 20;
print($nVale1 + $nValue2);

Expected result:
----------------
Expected:

30

No, it is:

20

Why, because of the typo in line 3. What I want to happen in that case is
this:

P error: p error in /somefile.php4 on line 3: unreferenced object
"$nVale1"

Actual result:
--------------
20

--
Edit bug report at [url]http://bugs.php.net/?id=26054&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=26054&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=26054&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=26054&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=26054&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=26054&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=26054&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=26054&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=26054&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=26054&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=26054&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=26054&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=26054&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=26054&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=26054&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=26054&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=26054&r=float[/url]