|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-01-15 14:38 UTC] danack@php.net
-Status: Open
+Status: Feedback
-Package: Feature/Change Request
+Package: *General Issues
[2016-01-15 14:38 UTC] danack@php.net
[2016-01-24 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
Description: ------------ In all PHP version I've tested so far, using an undefined variable (see code below) will cause a notice to be thrown. However, it would be better to throw an error, since using an undefined variable can cause unpredictable results or (as in my case) data loss. Same would go to the "undefined index" notice for arrays. This could either be done by using an option, allowing users to turn it off or without an option, since PHP6 changes so many things that developers will have to adapt their scripts. Reproduce code: --------------- // Note that $bar isn't defined anywhere in the script $foo = $bar + 5; Expected result: ---------------- An error message that causes the script to cease running. Actual result: -------------- A notice ("Undefined variable $foo...") is thrown.