#23635 [NEW]: token_get_all returns incorrect result

From: Date: Thu, 15 May 2003 06:56:07 +0000
Subject: #23635 [NEW]: token_get_all returns incorrect result
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39689@lists.php.net to get a copy of this message
From: davey@php.net Operating system: Win32 (XP) PHP version: 4.3.2RC2 PHP Bug Type: Scripting Engine problem Bug description: token_get_all returns incorrect result 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 bug report at http://bugs.php.net/?id=23635&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23635&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23635&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23635&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23635&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23635&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23635&r=support Expected behavior: http://bugs.php.net/fix.php?id=23635&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23635&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23635&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23635&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23635&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23635&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23635&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23635&r=gnused

« previous php.bugs (#39689) next »