PHP_CompatInfo: warnings about PHP 4.4.x and tokenizer extension
| From: | Laurent Laville | Date: | Sat, 14 Jan 2006 15:03:41 +0000 |
| Subject: | PHP_CompatInfo: warnings about PHP 4.4.x and tokenizer extension | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-22533@lists.php.net to get a copy of this message | ||
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Posted-By: 80.236.57.3
Hi all,
i've just realized after an install of PHP_CompatInfo 1.0.0 on a Windows
XP platform that results are different from PHP 5.1.x and PHP 4.4.x
I know NOW that it's NOT PHP_CompatInfo what gave wrong results but php
token_get_all() function .
I get same results [1] under PHP 4.4.1 and PHP 4.4.2
while i get these results [2] under PHP 5.1.1
Have a special look on token_name identities:
Values are not the same.
Is it only a problem with windows platform or this diff is common for
all env (Linux, MacOSx, ... ) ?
Any feedback are welcome !
Laurent Laville
====================================
Here is the script to test:
<?php
$file = 'example.php';
$input = file_get_contents($file,1);
if (is_string($input)) {
$data = token_get_all($input);
echo '<pre>';
var_dump($data);
echo '</pre>';
foreach ($data as $arr) {
if (is_array($arr)) {
echo nl2br("$arr[0] == " . token_name($arr[0]) . "\n");
}
}
}
?>
example.php contains only
<?php
/* Get the Compatibility info for an entire folder (recursive) */
?>
[1] results with PHP4
************************
array(5) {
[0]=>
array(2) {
[0]=>
int(354)
[1]=>
string(6) "
array(2) {
[0]=>
int(357)
[1]=>
string(1) "
"
}
[2]=>
array(2) {
[0]=>
int(352)
[1]=>
string(65) "/* Get the Compatibility info for an entire folder
(recursive) */"
}
[3]=>
array(2) {
[0]=>
int(357)
[1]=>
string(3) "
"
}
[4]=>
array(2) {
[0]=>
int(356)
[1]=>
string(2) "?>"
}
}
354 == T_OPEN_TAG
357 == T_WHITESPACE
352 == T_COMMENT
357 == T_WHITESPACE
356 == T_CLOSE_TAG
[2] results with PHP5
************************
array(5) {
[0]=>
array(2) {
[0]=>
int(367)
[1]=>
string(6) "
array(2) {
[0]=>
int(370)
[1]=>
string(1) "
"
}
[2]=>
array(2) {
[0]=>
int(365)
[1]=>
string(65) "/* Get the Compatibility info for an entire folder
(recursive) */"
}
[3]=>
array(2) {
[0]=>
int(370)
[1]=>
string(3) "
"
}
[4]=>
array(2) {
[0]=>
int(369)
[1]=>
string(2) "?>"
}
}
367 == T_OPEN_TAG
370 == T_WHITESPACE
365 == T_COMMENT
370 == T_WHITESPACE
369 == T_CLOSE_TAG