#23635 [Opn->Bgs]: token_get_all returns incorrect result

From: Date: Thu, 15 May 2003 17:24:28 +0000
Subject: #23635 [Opn->Bgs]: token_get_all returns incorrect result
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39710@lists.php.net to get a copy of this message
 ID:               23635
 Updated by:       sniper@php.net
 Reported By:      davey@php.net
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Win32 (XP)
 PHP Version:      4.3.2RC2
 New Comment:

You're propably saving the script in some weird type,
I couldn't reproduce this with latest stable snapshot..



Previous Comments:
------------------------------------------------------------------------

[2003-05-15 02:04:24] davey@php.net

Using PHP 4.3.1 on the *nix server, forgot to mention that.

- Davey

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

[2003-05-15 01:56:07] davey@php.net

With token_get_all(), the return on win32 is slightly different to on
*nix. The difference is with all those characters that do not have a
T_FOO name, which results in them not being in an array, my problem is
that the character in there is not correct.

Win32 var_dump output:
[29]=>
string(3) "; U"

*nix var_dump output:
[29]=>
string(1) ";"

require_once 'PEAR/Command/Common.php'U is the printed output on win32

require_once 'PEAR/Command/Common.php'; is the printed output for the
same line on *nix (FBSD 4.4).

Every single one of these characters is
string(3) "CHAR U" which makes it impossible to even work around using
str_replace or the like.

I believe the U is a \r or some such... not *too* sure. I think that
might be mozillas way of showing unknown characters within <pre>
output.

Sample script:

<?php
    $tokens =
token_get_all(file_get_contents($_SERVER['SCRIPT_FILENAME']));
    echo "<pre>";
    var_dump($tokens);
    echo "</pre>";
?>

- Davey

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


-- 
Edit this bug report at http://bugs.php.net/?id=23635&edit=1



Thread (3 messages)

« previous php.bugs (#39710) next »