[FX.php List] Suggestions on finding parse errors in long PHP pages

Jonathan Schwartz jschwartz at exit445.com
Wed Nov 28 14:31:43 MST 2007


Funny...I'm about go in the other direction.  I learned to code html, 
php and fx.php one character at time using BBEDIT.  Now, with the 
need to be more efficient with web layouts, CSS and syntax 
validation, I'm going to bring DW back into the picture.  Trying to 
whittle down the 300 or so syntax validation errors I get on my 
handcrafted self-taught html code. ;-)

J


At 2:53 PM -0600 11/28/07, Bob Patin wrote:
>Yes, but it won't help with typos though! :)
>
>I'm careful to use indenting, which is useful for eyeballing, and I 
>also comment the close brackets on IF statements when they're really 
>spread out (especially when I use a close bracket at the end of an 
>HTML page, and the IF statement started at the top of the page).
>
>I love Dreamweaver and am having a hard time giving it up; I know 
>that Joel is a big TextMate guy, and I tried it, but it's hard to 
>move away from DW when it does everything in one place. The drag, 
>though, is that parse error line numbers don't relate at all to what 
>DW shows. I may have to use TextMate for finding these errors, 
>especially in a form page when it has 500-600 lines of code.
>
>BP
>
>
>On Nov 28, 2007, at 2:04 PM, Gjermund Gusland Thorsen wrote:
>
>>Very often a goodstyle of programming will help you narrow down the
>>amount of ifs
>>and also indenting correcly will make it easier to find such errors.
>>
>>ggt
>>
>>On Nov 28, 2007 8:10 PM, Jonathan Schwartz <jschwartz at exit445.com> wrote:
>>>Oh my god, yes!
>>>
>>>There's always a one-to-one match between php errors and BBEDIT 
>>>line numbers.
>>>
>>>As I mentioned before...it's only when the PHP interpreter (or
>>>fx.php?) doesn't find a closing "if" bracket does the search begin.
>>>
>>>Also....and I'm not real clear on this....I also use "echo markers"
>>>in the code to narrow down where the script is going awry...but the
>>>script will not run at all if the interpreter chokes based on
>>>cerrtain conditions...mismatched brackets is one of them.
>>>
>>>HTH,
>>>
>>>Jonathan
>>>
>>>
>>>
>>>
>>>At 12:40 PM -0600 11/28/07, Bob Patin wrote:
>>>>Jonathan,
>>>>
>>>>I found it on line 383 (the parse error said line 294): instead of
>>>>"echo" I'd typed "cho".
>>>>
>>>>So would BBEdit show things on their correct lines?
>>>>
>>>>BP
>>>>
>>>>
>>>>On Nov 28, 2007, at 12:32 PM, Jonathan Schwartz wrote:
>>>>
>>>>>Bob,
>>>>>
>>>>>This is always a lot of fun.
>>>>>
>>>>>If the error isn't on the line number offered, then we are talking
>>>>>missing "}" in a if statement, no?
>>>>>
>>>>>If so, I use the latest version of BBEDIT that offers the ability
>>>>>to visually see in the Margin, the symbols indicating opening and
>>>>>closing if statements.  Although it doesn't wave at you, it is just
>>>>>a matter to narrow down the location of the mssing closing bracket.
>>>>>
>>>>>Not sure if that is the issue for you.  HTH.
>>>>>
>>>>>If you find a more intelligent method, I'd love to hear.
>>>>>
>>>>>Jonathan
>>>>>
>>>>>
>>>>>At 12:21 PM -0600 11/28/07, Bob Patin wrote:
>>>>>>I have a form that has embedded PHP all the way down, on approx.
>>>>>>40 survey questions; now that I managed to get to the bottom of
>>>>>>the form and test it, I'm getting a parse error.
>>>>>>
>>>>>>The problem is that the error msg. lists a line that isn't
>>>>>>relevant to the actual lines of the code; do you guys have a way
>>>>>>to take the parse error line # and interpolate it so that it shows
>>>>>>the actual error line?
>>>>>>
>>>>>>Thanks,
>>>>>>
>>>>>>Bob Patin
>>>>>
>>>>>--
>>>>>Jonathan Schwartz
>>>>>Exit 445 Group
>>>>>jonathan at exit445.com
>>>>>http://www.exit445.com
>>>>>415-381-1852
>>>>>_______________________________________________
>>>>>FX.php_List mailing list
>>>>>FX.php_List at mail.iviking.org
>>>>>http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>
>>>>_______________________________________________
>>>>FX.php_List mailing list
>>>>FX.php_List at mail.iviking.org
>>>>http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>>>
>>>--
>>>Jonathan Schwartz
>>>Exit 445 Group
>>>jonathan at exit445.com
>>>http://www.exit445.com
>>>415-381-1852
>>>_______________________________________________
>>>FX.php_List mailing list
>>>FX.php_List at mail.iviking.org
>>>http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>>_______________________________________________
>>FX.php_List mailing list
>>FX.php_List at mail.iviking.org
>>http://www.iviking.org/mailman/listinfo/fx.php_list
>
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list


-- 
Jonathan Schwartz
Exit 445 Group
jonathan at exit445.com
http://www.exit445.com
415-381-1852


More information about the FX.php_List mailing list