php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #54089
Patch tokenizer_patch_full.txt revision 2011-09-15 14:32 UTC by nikic@php.net
revision 2011-09-13 17:11 UTC by nikic@php.net
Patch tokenizer_patch.txt revision 2011-09-15 14:27 UTC by nikic@php.net
revision 2011-09-13 15:50 UTC by nikic@php.net
revision 2011-09-13 07:51 UTC by nicolas dot grekas+php at gmail dot com

Patch tokenizer_patch_full.txt for Unknown/Other Function Bug #54089

Patch version 2011-09-15 14:32 UTC

Return to Bug #54089 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2011-09-15 14:32 UTC | 2011-09-13 17:11 UTC

Developer: nikic@php.net



  Index: ext/tokenizer/tests/bug54089.phpt
  ===================================================================
 --- ext/tokenizer/tests/bug54089.phpt	(revision 316568)
 --- ext/tokenizer/tests/bug54089.phpt	(revision 316815)
  +++ ext/tokenizer/tests/bug54089.phpt	(working copy)
  @@ -4,17 +4,26 @@
   <?php if (!extension_loaded("tokenizer")) print "skip"; ?>
   --FILE--


  +def
  +ghi ABC"
  Index: ext/tokenizer/tests/token_get_all_variation16.phpt
  ===================================================================
 --- ext/tokenizer/tests/token_get_all_variation16.phpt	(revision 316568)
 --- ext/tokenizer/tests/token_get_all_variation16.phpt	(revision 316815)
  +++ ext/tokenizer/tests/token_get_all_variation16.phpt	(working copy)
  @@ -47,17 +47,17 @@
   
   list($value1,$value2) = $c;


   }
   Done
  Index: ext/tokenizer/tokenizer.c
  ===================================================================
 --- ext/tokenizer/tokenizer.c	(revision 316568)
 --- ext/tokenizer/tokenizer.c	(revision 316815)
  +++ ext/tokenizer/tokenizer.c	(working copy)
  @@ -32,8 +32,10 @@
   #include "zend_language_scanner_defs.h"
   #include <zend_language_parser.h>


  +	int need_tokens = -1; // for __halt_compiler lexing. -1 = disabled
   
   	array_init(return_value);
   
 @@ -150,11 +153,25 @@
 @@ -150,11 +153,28 @@
   		}
   		ZVAL_NULL(&token);
   
  +		// after T_HALT_COMPILER collect the next three non-dropped tokens
  +		if (need_tokens != -1) {
 +			if (destroy && --need_tokens == 0) {
 +			if (token_type != T_WHITESPACE && token_type != T_OPEN_TAG
 +			    && token_type != T_COMMENT && token_type != T_DOC_COMMENT
 +			    && --need_tokens == 0
 +			) {
  +				// fetch the rest into a T_INLINE_HTML
  +				if (zendcursor != zendlimit) {
  +					MAKE_STD_ZVAL(keyword);
  +					array_init(keyword);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 21:01:28 2024 UTC