[PHP-DEV] PHP 4.0 Bug #7992 Updated: Non-Quoted Strings = bad idea From: torben <email protected>
Date: 11/27/00

ID: 7992
Updated by: torben
Reported By: walhu <email protected>
Status: Closed
Bug Type: Feature/Change Request
Assigned To:
Comments:

Already in the language. Use error_reporting(E_ALL) to
develop your apps and then turn down the reporting level for
production.

Script:
-------------------------
<?php
error_reporting(E_ALL);

$periodCount = 3;
$sum = 2 * periodCount; // missing $ at periodCount
echo "sum $sum";
?>
-------------------------

Ouput:
-------------------------
Warning: Use of undefined constant periodCount - assumed 'periodCount' in /home/torben/public_html/phptest/__phplist.html on line 18
sum 0
-------------------------

Previous Comments:
---------------------------------------------------------------------------

[2000-11-27 09:04:47] walhu <email protected>
this codesnippet:
==========
$periodCount=3;
$sum = 2*periodCount; // missing $ at periodCount
echo "sum $sum";
==========
gives: "sum 0" as result

I expect to get a parse error because of the unknown identifier.
This kind of typo can be #very# hard to find.

Please remove/(make as option) these non-quoted strings.

Is there a feature (planned) to force the detection of non declared variables?

---------------------------------------------------------------------------

Full Bug description available at: http://bugs.php.net/?id=7992

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>