NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
PHP bugged when going through HTML code
Veteran

Joined: 28 Nov 2005
Posts: 144
Reply with quote
Hi,
in my code I've a problem with the debugger which goes on the wrong line after I've something like

echo <<<TEXT
bla bla
bla bla
TEXT;

when the cursor goes after TEXT; it starts at wrong line (it stops on blank lines and so on). everything continue going a line ahead. Putting the HTML code at the end of the scripts doesn't give problems.

I'm using phped 4.5 and DBG 1.20
View user's profileFind all posts by blackSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
Neither Debugger nor IDE has anything to do with line numbering. It is a pure PHP bug. Feel free to submit it at bugs.php.net.
To make sense, try code below

Code:
<?php
echo __LINE__."<br>";
echo <<<TEXT
bla bla
bla bla<br>
TEXT;
echo __LINE__."<br>";
?>


it will print
2<br>bla bla
bla bla<br>8<br>

instead of

2<br>bla bla
bla bla<br>7<br>

source of this problem is php tokenizer with unput() incorrectly used.


Last edited by dmitri on Thu Mar 30, 2006 4:59 am; edited 1 time in total
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 28 Nov 2005
Posts: 144
Reply with quote
thanks for the response; as you know it'a php bug do you know it it affects all the php versions or some version has this bug solved?

Thanks
View user's profileFind all posts by blackSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
as far as I know this particular bug is in all official versions distributed from php.net
while php that was compiled by me from the same sources is free of this bug.
I don't know what's up with their build system. Probably Wez knows better.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 28 Nov 2005
Posts: 144
Reply with quote
I've submitted this bug to php.net; I've noticed that it was solved about 3 years ago, but now it's again with us Smile
View user's profileFind all posts by blackSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
don't forget that bug is only in the binaries they compile and put on php.net
thanks for submitting it.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
Just in case, I prepared php-4.4.1 that seems does not have this bug with line numbering:
http://forum.nusphere.com/sshot/NuSphere-phped-4.0-php4.4.1-Win32.exe

after installed, please run phpinfo() and check if debugger module is there
(2.18.5 for phped v4 and 2.20.2 for phped v4.5)
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 22 Sep 2005
Posts: 110
Reply with quote
Both php v5.1.2 from php.net and the one bundled with phpEd 4.01(b4060) have the same bug. Is it possible to get a binary from Nusphere without this bug?
View user's profileFind all posts by HoTShoTSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
Right. We provided official php binaries without any modifications.
Regarding bugs in php,
although it's not our mission to fix them, should we have the fix, we would submit it shortly.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
PHP bugged when going through HTML code
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic