Re: PHP_CompatInfo: warnings about PHP 4.4.x and tokenizer extension

From: Date: Sun, 15 Jan 2006 03:37:01 +0000
Subject: Re: PHP_CompatInfo: warnings about PHP 4.4.x and tokenizer extension
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-22537@lists.php.net to get a copy of this message
Laurent Laville wrote: > 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 This is an annoying fact. Alan and I ran up against this when working on PHP_Parser a long time ago. In fact, we found that the values assigned to tokens was non-determistic, and were able to get at least 3 different mappings of tokens => integer value on different systems. Our solution was to iterate over a set of integers known to be within the range of possibility, and then to use that to determine the correct integer value. You can see the result of the work in the PHP_Parser_Tokenizer class, which may be useful if you need the numbers. I have no freakin' idea why the token numbers are different in the *same* PHP version, but I can tell you that the intenral order of definition did indeed change in PHP 5 from PHP 4. This is actually in the Zend engine itself, and not in the tokenizer extension, which reflects this change rather than creates it. Greg

« previous php.pear.general (#22537) next »