Explicit declaration of variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • magilla

    Explicit declaration of variables

    I'm a old timer programmer (assembler, fortran, pascal, C) and now
    converting from PERL to PHP. In PERL I always use the "use strict" to
    force warning messages of undeclared variables. I haven't been able to
    find anything similar in PHP, is there such an option? When you type
    as bad as I do, having the PHP interpretor/compiler find misspelled
    variable names expedites the debugging process.

    Magilla...

  • d

    #2
    Re: Explicit declaration of variables

    "magilla" <jim.richardson @jax.org> wrote in message
    news:1137506263 .350278.111170@ g47g2000cwa.goo glegroups.com.. .[color=blue]
    > I'm a old timer programmer (assembler, fortran, pascal, C) and now
    > converting from PERL to PHP. In PERL I always use the "use strict" to
    > force warning messages of undeclared variables. I haven't been able to
    > find anything similar in PHP, is there such an option? When you type
    > as bad as I do, having the PHP interpretor/compiler find misspelled
    > variable names expedites the debugging process.
    >
    > Magilla...
    >[/color]

    If you turn your error reporting on:



    It will indeed give you helpful messages like:

    Notice: Undefined variable: somethin in /blah/woo/waah.php

    :)


    Comment

    Working...