php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #18430 abnormal syntax still runs
Submitted: 2002-07-19 04:35 UTC Modified: 2002-07-19 05:41 UTC
From: fuser at abv dot bg Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.2.0 OS: Linux 2.4.19
Private report: No CVE-ID: None
 [2002-07-19 04:35 UTC] fuser at abv dot bg
Actually I'm not reporting a bug of the PHP. I am reporing bug of myself. With few words I am a buggy programmer. For example i write for ($i = 0; i < $k; $i ++), and you know what happens when 'i' is not defined. So i have a proposition that somebody from the PHP Group write a parser that is little strictier about such things. A parser not part of the PHP engine but mostly a debug tool.For example if such thing exist you do the following:
1. mark a part of your code to be checked with a given tag, for example <CHECK> .......
.......... code ..........
.......................... </CHECK>
2. this tool have some strictlier requirments towards your code for example to define each variable with 'var' thus checking for not defined variables, to mark somehow external variables that can be let in (oops they had to be globals).Type checking and definition according to me is 
useless and not really possible at this point of time.
3. Things like that. This idea is due to my first immpression so a suppose there may be other such things.

If such tool exist PLEASE TELL ME.
If such tool doesn't exist and u the reader find this interesting to any extent PLEASE TELL ME.

   I sincerely appologise that I used your time for not what it was meant to be used. I hope u understand how silly is to write "for ($i = 0; i < 8; $i ++)"

                                 Faithfully yours,
                                 fuser

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-19 05:41 UTC] derick@php.net
We have a function for this:
set_error_reporting(E_ALL);
If you put that at the top of your script, it will show undefined variables.

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 29 19:01:30 2024 UTC