rfc:token-get-always-tokens

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:token-get-always-tokens [2016/01/05 04:00] – 1.0/Under Discussion pollitarfc:token-get-always-tokens [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== PHP RFC: token_get_all() flag to return consistent elements ====== ====== PHP RFC: token_get_all() flag to return consistent elements ======
-  * Version: 1.0+  * Version: 1.1
   * Date: 2016-01-04   * Date: 2016-01-04
   * Author: Sara Golemon <pollita@php.net>   * Author: Sara Golemon <pollita@php.net>
Line 21: Line 21:
  
 ===== Proposal ===== ===== Proposal =====
-This proposal aims to normalize the output of token_get_all (when requested) by always using associative arrays as the sub-elements in the output.  For example, token_get_all("<?php ;", TOKEN_FULL) would output:+This proposal aims to normalize the output of token_get_all (when requested) by always using associative arrays as the sub-elements in the output.  For example, token_get_all("<?php ;", TOKEN_ASSOC) would output:
  
   Array (   Array (
     [0] => Array (     [0] => Array (
-      [token] => int(374)+      [id] => int(374)
       [text] => string(6)"<?php "       [text] => string(6)"<?php "
       [line] => int(1)       [line] => int(1)
     )     )
     [1] => Array (     [1] => Array (
-      [token] => int(59)  // 59 == ord(';')+      [id] => int(59)  // 59 == ord(';')
       [text] => string(1) ";"       [text] => string(1) ";"
       [line] => int(1)       [line] => int(1)
Line 36: Line 36:
   )    ) 
  
-Note the use of a new constant TOKEN_FULL to be used with the flags parameter introduced in PHP 7.0+Note the use of a new constant TOKEN_ASSOC to be used with the flags parameter introduced in PHP 7.0
  
 ==== Additional changes ==== ==== Additional changes ====
Line 51: Line 51:
  
 ==== New Constants ==== ==== New Constants ====
-TOKEN_FULL - When present, token_get_all() will use the new format+TOKEN_ASSOC - When present, token_get_all() will use the new format
  
 ===== Future Scope ===== ===== Future Scope =====
Line 57: Line 57:
  
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
-Introduce TOKEN_FULL and new scanner output format? 50% majority required+Introduce TOKEN_ASSOC and new scanner output format? 50% majority required
  
rfc/token-get-always-tokens.1451966408.txt.gz · Last modified: 2017/09/22 13:28 (external edit)