rfc:token_as_object

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:token_as_object [2020/03/06 09:32]
nikic
rfc:token_as_object [2020/11/12 13:33] (current)
nikic
Line 2: Line 2:
   * Date: 2020-02-13   * Date: 2020-02-13
   * Author: Nikita Popov <nikic@php.net>   * Author: Nikita Popov <nikic@php.net>
-  * Status: Voting+  * Status: Implemented
   * Target Version: PHP 8.0   * Target Version: PHP 8.0
   * Implementation: https://github.com/php/php-src/pull/5176   * Implementation: https://github.com/php/php-src/pull/5176
Line 9: Line 9:
  
 The ''token_get_all()'' function currently returns tokens either as a single-character string, or an array with a token ID, token text and line number. This RFC proposes to add a token_get_all() alternative which returns an array of objects instead. This reduces memory usage and makes code operating on tokens more readable. The ''token_get_all()'' function currently returns tokens either as a single-character string, or an array with a token ID, token text and line number. This RFC proposes to add a token_get_all() alternative which returns an array of objects instead. This reduces memory usage and makes code operating on tokens more readable.
 +
 +> **Note:** PhpToken::getAll() has been renamed to PhpToken::tokenize() prior to the PHP 8.0 release. The RFC text still refers to PhpToken::getAll().
  
 ===== Proposal ===== ===== Proposal =====
Line 183: Line 185:
 Voting opened 2020-03-06 and closes 2020-03-20. Voting opened 2020-03-06 and closes 2020-03-20.
  
-<doodle title="Add object-based token_get_all() alternative?" auth="nikic" voteType="single" closed="false">+<doodle title="Add object-based token_get_all() alternative?" auth="nikic" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
 </doodle> </doodle>
  
rfc/token_as_object.1583487138.txt.gz · Last modified: 2020/03/06 09:32 by nikic