Linenumber of errors/warnings/notices often wrong.

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

    Linenumber of errors/warnings/notices often wrong.

    Hi group,

    I have this very annoying problem during development: the linenumbers PHP
    says contain a error/warning/notice are completely wrong.

    When?
    When I use includes and make a mistake.

    WHat do I use?
    The defaultbuild that came with redhat8.
    PHP Version 4.2.2
    (Information at the end of this message.)

    This situation is very annoying because I have to search often very long
    scripts to find a stupid ; or "

    As far as I can tell this doesn't happen when I do not use includes...

    Upgrading to another version (PHP5) is not an option. I had to set up this
    version to mimic my serverconfigura tion.

    Can anybody help me?


    Regards,
    Erwin Moller

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







    info about my PHP
    -----------------------------------------------
    PHP Version 4.2.2

    System Linux daffy.perf.redh at.com 2.4.20-2.48smp #1 SMP Thu Feb 13 11:44:55
    EST 2003 i686 i686 i386 GNU/Linux

    Build Date Jun 19 2003 10:27:30

    Configure Command './configure' '--host=i386-redhat-l
    inux' '--build=i386-redhat-linux' '--target=i386-redhat-linux
    -gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=
    /usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=
    /etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr
    /lib' '--libexecdir=/usr/libexec' '--localstatedir=
    /var' '--sharedstatedir=/usr/com' '--mandir=/usr/share
    /man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=
    /etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable
    -pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with
    -db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr
    /bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--wit
    h-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-get
    text' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=
    /usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=sy
    stem' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout
    =GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-qu
    otes' '--enable-safe-mode' '--enable-sockets' '--enable-sys
    vsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-
    vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-
    oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap
    -ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=sh
    ared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,
    /usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=sh
    ared' '--enable-memory-limit' '--enable-bcmath' '--enable-s
    hmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable
    -dio' '--enable-mcal' '--with-apxs2=/usr/sbin/apxs'

    Server API Apache 2.0 Filter
  • AJ

    #2
    Re: Linenumber of errors/warnings/notices often wrong.

    On Wed, 12 May 2004 10:48:53 +0200, Erwin Moller
    <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> wrote:
    [color=blue]
    > Hi group,
    >
    > I have this very annoying problem during development: the linenumbers PHP
    > says contain a error/warning/notice are completely wrong.
    >
    > When?
    > When I use includes and make a mistake.
    >
    > WHat do I use?
    > The defaultbuild that came with redhat8.
    > PHP Version 4.2.2
    > (Information at the end of this message.)
    >
    > This situation is very annoying because I have to search often very long
    > scripts to find a stupid ; or "
    >
    > As far as I can tell this doesn't happen when I do not use includes...
    >
    > Upgrading to another version (PHP5) is not an option. I had to set up
    > this
    > version to mimic my serverconfigura tion.
    >
    > Can anybody help me?
    >
    >
    > Regards,
    > Erwin Moller
    >
    > ----------------------------------------[/color]

    I am guessing here, but I used to find this. However, it didn't generally
    happen when I had misplaced ; or " it was more with () {} which makes more
    sense as these section off various bits of code, and PHP throws the line
    number at the beginning of that section I think. I don't think it
    necessarily happens only with includes though.

    I don't get the problem any more though. either that is because I have
    subconciously learnt not to do it, or it is for one of the following
    reasons:

    I now indent my code much more strictly, and keep everything to its own
    line.
    I now use PHP5 (I know this wasn't an option for you...)
    I now run it under Windows (Again not an option).

    Hopefully this may help you a little.

    Harry

    Comment

    • R. Rajesh Jeba Anbiah

      #3
      Re: Linenumber of errors/warnings/notices often wrong.

      Erwin Moller <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> wrote in message news:<40a1e4ed$ 0$561$e4fe514c@ news.xs4all.nl> ...[color=blue]
      > Hi group,
      >
      > I have this very annoying problem during development: the linenumbers PHP
      > says contain a error/warning/notice are completely wrong.
      >
      > When?
      > When I use includes and make a mistake.[/color]

      <snip>

      Hmm... Recently someone else also reported similar problem. But, it
      doesn't happen to me as I'm using PHPEdit
      <http://www.phpedit.net/products/PHPEdit/> (Now runs in Linux?) It has
      a debugger, so if I click the "Run" it will point the cursor at the
      exact line of the error and can easily trap the missing quotes or
      parenthesis because of it's syntax highlight features.

      --
      | Just another PHP saint |
      Email: rrjanbiah-at-Y!com

      Comment

      • Erwin Moller

        #4
        Re: Linenumber of errors/warnings/notices often wrong.

        R. Rajesh Jeba Anbiah wrote:
        [color=blue]
        > Erwin Moller
        > <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> wrote in
        > message news:<40a1e4ed$ 0$561$e4fe514c@ news.xs4all.nl> ...[color=green]
        >> Hi group,
        >>
        >> I have this very annoying problem during development: the linenumbers PHP
        >> says contain a error/warning/notice are completely wrong.
        >>
        >> When?
        >> When I use includes and make a mistake.[/color]
        >
        > <snip>
        >
        > Hmm... Recently someone else also reported similar problem. But, it
        > doesn't happen to me as I'm using PHPEdit
        > <http://www.phpedit.net/products/PHPEdit/> (Now runs in Linux?) It has
        > a debugger, so if I click the "Run" it will point the cursor at the
        > exact line of the error and can easily trap the missing quotes or
        > parenthesis because of it's syntax highlight features.
        >[/color]

        Hi,

        Thanks for responding.
        I use Eclipse with PHP-plugin.
        But I don't think the problem is in the editor. The resulting .php file just
        contains normal end-of-lines which should be reported correct by php.

        I expect some bug in PHP error/warning/notice-reporting. :-(

        Regards,
        VFY

        Comment

        • Erwin Moller

          #5
          Re: Linenumber of errors/warnings/notices often wrong.

          AJ wrote:
          [color=blue]
          > On Wed, 12 May 2004 10:48:53 +0200, Erwin Moller
          > <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> wrote:
          >[color=green]
          >> Hi group,
          >>
          >> I have this very annoying problem during development: the linenumbers PHP
          >> says contain a error/warning/notice are completely wrong.
          >>
          >> When?
          >> When I use includes and make a mistake.
          >>
          >> WHat do I use?
          >> The defaultbuild that came with redhat8.
          >> PHP Version 4.2.2
          >> (Information at the end of this message.)
          >>
          >> This situation is very annoying because I have to search often very long
          >> scripts to find a stupid ; or "
          >>
          >> As far as I can tell this doesn't happen when I do not use includes...
          >>
          >> Upgrading to another version (PHP5) is not an option. I had to set up
          >> this
          >> version to mimic my serverconfigura tion.
          >>
          >> Can anybody help me?
          >>
          >>
          >> Regards,
          >> Erwin Moller
          >>
          >> ----------------------------------------[/color]
          >[/color]

          Hi Harry,

          Thanks for your respons.
          [color=blue]
          > I am guessing here, but I used to find this. However, it didn't generally
          > happen when I had misplaced ; or " it was more with () {} which makes more
          > sense as these section off various bits of code, and PHP throws the line
          > number at the beginning of that section I think. I don't think it
          > necessarily happens only with includes though.[/color]

          Erm, I am not sure I understand what you mean.
          Everybody who codes PHP uses {} and () a lot.
          How to circumvent excactly? What do you mean excactly?
          [color=blue]
          >
          > I don't get the problem any more though. either that is because I have
          > subconciously learnt not to do it, or it is for one of the following
          > reasons:
          >
          > I now indent my code much more strictly, and keep everything to its own
          > line.[/color]

          I do that too. :-)
          Just because it keeps my code readable.
          [color=blue]
          > I now use PHP5 (I know this wasn't an option for you...)
          > I now run it under Windows (Again not an option).[/color]

          Yes, I guess one of the above is the reason.
          [color=blue]
          >
          > Hopefully this may help you a little.[/color]

          No, I am still stuck to my regret. :-(
          But thanks for your response!
          [color=blue]
          >
          > Harry[/color]

          Regards,
          Erwin Moller

          Comment

          • AJ

            #6
            Re: Linenumber of errors/warnings/notices often wrong.

            On Fri, 14 May 2004 10:48:39 +0200, Erwin Moller
            <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> wrote:
            [color=blue]
            > AJ wrote:[color=green]
            >> I am guessing here, but I used to find this. However, it didn't
            >> generally
            >> happen when I had misplaced ; or " it was more with () {} which makes
            >> more
            >> sense as these section off various bits of code, and PHP throws the line
            >> number at the beginning of that section I think. I don't think it
            >> necessarily happens only with includes though.[/color]
            >
            > Erm, I am not sure I understand what you mean.
            > Everybody who codes PHP uses {} and () a lot.
            > How to circumvent excactly? What do you mean excactly?
            >[/color]

            Take this code:

            1: if ($this == $that) {
            2: $that = $somethingelse;
            3: $theother = $this;
            4: }
            5: else {
            6: $this = $somethingelse;
            7: $theother = $that;
            8: }

            If you were to misplace the semicolon at the end of line 2, the error
            message, would say something about line 3. If you were to misplace the }
            on line 4, it might report the error as being on line 1 (although probably
            not in a simple case like this. but it is this sort of scenario that might
            cause you problems...

            I'm afraid I can't explain much better than that, because I am not certain
            exactly what caused the problem.

            H

            Comment

            • Erwin Moller

              #7
              Re: Linenumber of errors/warnings/notices often wrong.

              AJ wrote:
              [color=blue]
              > On Fri, 14 May 2004 10:48:39 +0200, Erwin Moller[/color]
              [color=blue][color=green]
              >>
              >> Erm, I am not sure I understand what you mean.
              >> Everybody who codes PHP uses {} and () a lot.
              >> How to circumvent excactly? What do you mean excactly?
              >>[/color]
              >
              > Take this code:
              >
              > 1: if ($this == $that) {
              > 2: $that = $somethingelse;
              > 3: $theother = $this;
              > 4: }
              > 5: else {
              > 6: $this = $somethingelse;
              > 7: $theother = $that;
              > 8: }
              >
              > If you were to misplace the semicolon at the end of line 2, the error
              > message, would say something about line 3. If you were to misplace the }
              > on line 4, it might report the error as being on line 1 (although probably
              > not in a simple case like this. but it is this sort of scenario that might
              > cause you problems...
              >
              > I'm afraid I can't explain much better than that, because I am not certain
              > exactly what caused the problem.
              >
              > H[/color]

              Hi,

              Aha, I understand what you mean. Misplaced ; can confuse PHP's
              linenumbering.
              I'll keep that in mind, allthough in my case PHP is more like 50 linenumbers
              wrong. :-(

              Thanks for your time and response!

              Regards,
              Erwin Moller

              Comment

              • R. Rajesh Jeba Anbiah

                #8
                [OT, ?VFY] Re: Linenumber of errors/warnings/notices often wrong.

                Erwin Moller <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> wrote in message news:<40a47e9b$ 0$571$e4fe514c@ news.xs4all.nl> ...
                <snip>[color=blue]
                > Regards,
                > VFY[/color]

                VFY?? You mean verify? Just curious...

                --
                | Just another PHP saint |
                Email: rrjanbiah-at-Y!com

                Comment

                • Erwin Moller

                  #9
                  Re: [OT, ?VFY] Re: Linenumber of errors/warnings/notices often wrong.

                  R. Rajesh Jeba Anbiah wrote:
                  [color=blue]
                  > Erwin Moller
                  > <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> wrote in
                  > message news:<40a47e9b$ 0$571$e4fe514c@ news.xs4all.nl> ...
                  > <snip>[color=green]
                  >> Regards,
                  >> VFY[/color]
                  >
                  > VFY?? You mean verify? Just curious...
                  >[/color]

                  Sorry, that VFY my nick somewhere else. (Utopia)
                  I shouldn't use it here.
                  Slip of my fingers. :-)

                  Regards,
                  Erwin Moller

                  Comment

                  • R. Rajesh Jeba Anbiah

                    #10
                    Re: [OT, ?VFY] Re: Linenumber of errors/warnings/notices often wrong.

                    Erwin Moller <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> wrote in message news:<40ac90c6$ 0$15375$e4fe514 c@news.xs4all.n l>...
                    <snip>[color=blue]
                    > Sorry, that VFY my nick somewhere else. (Utopia)
                    > I shouldn't use it here.
                    > Slip of my fingers. :-)[/color]

                    Ok, no problem. Nice to know your nick :-)

                    --
                    | Just another PHP saint |
                    Email: rrjanbiah-at-Y!com

                    Comment

                    Working...