|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-12-02 09:19 UTC] nikic@php.net
[2020-12-02 09:19 UTC] nikic@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 16:00:01 2025 UTC |
Description: ------------ On: PHP 8.0.0 (cli) (built: Dec 1 2020 04:01:52) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies When tokenizing as following: ``` <?php token_get_all('<?php $foo = $a?->b();', TOKEN_PARSE); ``` the T_NULLSAFE_OBJECT_OPERATOR is missing https://3v4l.org/t5aAA Test script: --------------- ``` <?php token_get_all('<?php $foo = $a?->b();', TOKEN_PARSE); ``` results in something like: ``` array(10) { [0]=> array(3) { [0]=> int(390) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(315) [1]=> string(4) "$foo" [2]=> int(1) } [2]=> array(3) { [0]=> int(393) [1]=> string(1) " " [2]=> int(1) } [3]=> string(1) "=" [4]=> array(3) { [0]=> int(393) [1]=> string(1) " " [2]=> int(1) } [5]=> array(3) { [0]=> int(315) [1]=> string(2) "$a" [2]=> int(1) } [6]=> array(3) { [0]=> int(311) [1]=> string(1) "b" [2]=> int(1) } [7]=> string(1) "(" [8]=> string(1) ")" [9]=> string(1) ";" } ``` expected same result as ``` <?php token_get_all('<?php $foo = $a?->b();'); ``` ``` array(11) { [0]=> array(3) { [0]=> int(390) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(315) [1]=> string(4) "$foo" [2]=> int(1) } [2]=> array(3) { [0]=> int(393) [1]=> string(1) " " [2]=> int(1) } [3]=> string(1) "=" [4]=> array(3) { [0]=> int(393) [1]=> string(1) " " [2]=> int(1) } [5]=> array(3) { [0]=> int(315) [1]=> string(2) "$a" [2]=> int(1) } [6]=> array(3) { [0]=> int(387) [1]=> string(3) "?->" [2]=> int(1) } [7]=> array(3) { [0]=> int(311) [1]=> string(1) "b" [2]=> int(1) } [8]=> string(1) "(" [9]=> string(1) ")" [10]=> string(1) ";" } ``` note the T_NULLSAFE_OBJECT_OPERATOR token @ index 6 https://3v4l.org/t5aAA