#27901 [Opn->Bgs]: highlight_* produces random results

From: Date: Sun, 25 Apr 2004 22:25:20 +0000
Subject: #27901 [Opn->Bgs]: highlight_* produces random results
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58751@lists.php.net to get a copy of this message
ID: 27901 Updated by: sniper@php.net Reported By: mr dot heat at gmx dot de -Status: Open +Status: Bogus Bug Type: Zend Engine 2 problem Operating System: i686-suse-linux PHP Version: 4.3.5 New Comment: There is no ZE2 in PHP 4..so either fix the version to the correct one (after testing with the latest snapshot) or leave this bogus. (btw. I can't reproduce after couple of hundred thousand runs..) Previous Comments: ------------------------------------------------------------------------ [2004-04-14 09:13:57] fb at fbeyer dot com You can even experience this bug within the user notes at the PHP home page. Sometimes the notes are highlighted even without beeing surrounded by PHP tags. Again, I can't see a rule when it works wrong and when it doesn't. Very weird! ------------------------------------------------------------------------ [2004-04-07 11:21:28] fb at fbeyer dot com I have seen this bug in action in the forum script at www.php-center.de and could also reproduce it using Thiemo's sample URL. You have to refresh the page periodically. I did not see any regularity, there are alternating iterations of correct and false behavior. ------------------------------------------------------------------------ [2004-04-07 11:11:42] mr dot heat at gmx dot de I tried again several minutes ago. First it displayed the wrong result. Then it displayed the right result and I was unable to get the wrong result again. It seems dependent from the time (?). ------------------------------------------------------------------------ [2004-04-07 08:22:43] derick@php.net I reloaded that site a couple of hundred times, but it always showed the correct result... ------------------------------------------------------------------------ [2004-04-07 06:05:27] mr dot heat at gmx dot de Description: ------------ highlight_string() produces strange random results (random means, I reload the page and get one of two different results). Sometimes the highlighted string starts in HTML mode (as expected), sometimes it starts in PHP mode (similar to eval()). The effect is, the whole highlighted string becomes blue. In "foo <?php bar(); ?>" for example "foo" becomes blue instead of black. Reproduce code: --------------- <?highlight_string("Text")?> Or check http://phpcenter.de/~thiemo/bug.php and reload the page sometimes. The script running there is: <?=htmlspecialchars(highlight_string("Text", true))?> Expected result: ---------------- <code><font color="#000000"> Text</font> </code> Actual result: -------------- Sometimes: <code><font color="#000000"> Text</font> </code> and sometimes (just reload the page sometimes without any change): <code><font color="#000000"> <font color="#0000BB">Text</font> </font> </code> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27901&edit=1

« previous php.bugs (#58751) next »