3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = '<?php public function enum($value, ...$items) {}'; $tokens = token_get_all($string); print_r($tokens);
based on Do8JP
Output for 7.0.0 - 7.1.0
Array ( [0] => Array ( [0] => 379 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 316 [1] => public [2] => 1 ) [2] => Array ( [0] => 382 [1] => [2] => 1 ) [3] => Array ( [0] => 346 [1] => function [2] => 1 ) [4] => Array ( [0] => 382 [1] => [2] => 1 ) [5] => Array ( [0] => 319 [1] => enum [2] => 1 ) [6] => ( [7] => Array ( [0] => 320 [1] => $value [2] => 1 ) [8] => , [9] => Array ( [0] => 382 [1] => [2] => 1 ) [10] => Array ( [0] => 391 [1] => ... [2] => 1 ) [11] => Array ( [0] => 320 [1] => $items [2] => 1 ) [12] => ) [13] => Array ( [0] => 382 [1] => [2] => 1 ) [14] => { [15] => } )
Output for hhvm-3.10.0 - 3.13.2
Array ( [0] => Array ( [0] => 368 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 342 [1] => public [2] => 1 ) [2] => Array ( [0] => 371 [1] => [2] => 1 ) [3] => Array ( [0] => 334 [1] => function [2] => 1 ) [4] => Array ( [0] => 371 [1] => [2] => 1 ) [5] => Array ( [0] => 307 [1] => enum [2] => 1 ) [6] => ( [7] => Array ( [0] => 309 [1] => $value [2] => 1 ) [8] => , [9] => Array ( [0] => 371 [1] => [2] => 1 ) [10] => Array ( [0] => 393 [1] => ... [2] => 1 ) [11] => Array ( [0] => 309 [1] => $items [2] => 1 ) [12] => ) [13] => Array ( [0] => 371 [1] => [2] => 1 ) [14] => { [15] => } )
Output for 5.6.0 - 5.6.28
Array ( [0] => Array ( [0] => 376 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 347 [1] => public [2] => 1 ) [2] => Array ( [0] => 379 [1] => [2] => 1 ) [3] => Array ( [0] => 337 [1] => function [2] => 1 ) [4] => Array ( [0] => 379 [1] => [2] => 1 ) [5] => Array ( [0] => 310 [1] => enum [2] => 1 ) [6] => ( [7] => Array ( [0] => 312 [1] => $value [2] => 1 ) [8] => , [9] => Array ( [0] => 379 [1] => [2] => 1 ) [10] => Array ( [0] => 389 [1] => ... [2] => 1 ) [11] => Array ( [0] => 312 [1] => $items [2] => 1 ) [12] => ) [13] => Array ( [0] => 379 [1] => [2] => 1 ) [14] => { [15] => } )
Output for 5.5.0 - 5.5.38
Array ( [0] => Array ( [0] => 374 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 345 [1] => public [2] => 1 ) [2] => Array ( [0] => 377 [1] => [2] => 1 ) [3] => Array ( [0] => 335 [1] => function [2] => 1 ) [4] => Array ( [0] => 377 [1] => [2] => 1 ) [5] => Array ( [0] => 308 [1] => enum [2] => 1 ) [6] => ( [7] => Array ( [0] => 310 [1] => $value [2] => 1 ) [8] => , [9] => Array ( [0] => 377 [1] => [2] => 1 ) [10] => . [11] => . [12] => . [13] => Array ( [0] => 310 [1] => $items [2] => 1 ) [14] => ) [15] => Array ( [0] => 377 [1] => [2] => 1 ) [16] => { [17] => } )
Output for 5.4.0 - 5.4.45
Array ( [0] => Array ( [0] => 372 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 343 [1] => public [2] => 1 ) [2] => Array ( [0] => 375 [1] => [2] => 1 ) [3] => Array ( [0] => 334 [1] => function [2] => 1 ) [4] => Array ( [0] => 375 [1] => [2] => 1 ) [5] => Array ( [0] => 307 [1] => enum [2] => 1 ) [6] => ( [7] => Array ( [0] => 309 [1] => $value [2] => 1 ) [8] => , [9] => Array ( [0] => 375 [1] => [2] => 1 ) [10] => . [11] => . [12] => . [13] => Array ( [0] => 309 [1] => $items [2] => 1 ) [14] => ) [15] => Array ( [0] => 375 [1] => [2] => 1 ) [16] => { [17] => } )
Output for 5.3.0 - 5.3.29
Array ( [0] => Array ( [0] => 368 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 342 [1] => public [2] => 1 ) [2] => Array ( [0] => 371 [1] => [2] => 1 ) [3] => Array ( [0] => 334 [1] => function [2] => 1 ) [4] => Array ( [0] => 371 [1] => [2] => 1 ) [5] => Array ( [0] => 307 [1] => enum [2] => 1 ) [6] => ( [7] => Array ( [0] => 309 [1] => $value [2] => 1 ) [8] => , [9] => Array ( [0] => 371 [1] => [2] => 1 ) [10] => . [11] => . [12] => . [13] => Array ( [0] => 309 [1] => $items [2] => 1 ) [14] => ) [15] => Array ( [0] => 371 [1] => [2] => 1 ) [16] => { [17] => } )
Output for 5.2.2 - 5.2.17
Array ( [0] => Array ( [0] => 367 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 341 [1] => public [2] => 1 ) [2] => Array ( [0] => 370 [1] => [2] => 1 ) [3] => Array ( [0] => 333 [1] => function [2] => 1 ) [4] => Array ( [0] => 370 [1] => [2] => 1 ) [5] => Array ( [0] => 307 [1] => enum [2] => 1 ) [6] => ( [7] => Array ( [0] => 309 [1] => $value [2] => 1 ) [8] => , [9] => Array ( [0] => 370 [1] => [2] => 1 ) [10] => . [11] => . [12] => . [13] => Array ( [0] => 309 [1] => $items [2] => 1 ) [14] => ) [15] => Array ( [0] => 370 [1] => [2] => 1 ) [16] => { [17] => } )
Output for 5.1.0 - 5.2.1
Array ( [0] => Array ( [0] => 367 [1] => <?php ) [1] => Array ( [0] => 341 [1] => public ) [2] => Array ( [0] => 370 [1] => ) [3] => Array ( [0] => 333 [1] => function ) [4] => Array ( [0] => 370 [1] => ) [5] => Array ( [0] => 307 [1] => enum ) [6] => ( [7] => Array ( [0] => 309 [1] => $value ) [8] => , [9] => Array ( [0] => 370 [1] => ) [10] => . [11] => . [12] => . [13] => Array ( [0] => 309 [1] => $items ) [14] => ) [15] => Array ( [0] => 370 [1] => ) [16] => { [17] => } )
Output for 5.0.0 - 5.0.5
Array ( [0] => Array ( [0] => 365 [1] => <?php ) [1] => Array ( [0] => 345 [1] => public ) [2] => Array ( [0] => 368 [1] => ) [3] => Array ( [0] => 332 [1] => function ) [4] => Array ( [0] => 368 [1] => ) [5] => Array ( [0] => 306 [1] => enum ) [6] => ( [7] => Array ( [0] => 308 [1] => $value ) [8] => , [9] => Array ( [0] => 368 [1] => ) [10] => . [11] => . [12] => . [13] => Array ( [0] => 308 [1] => $items ) [14] => ) [15] => Array ( [0] => 368 [1] => ) [16] => { [17] => } )
Output for 4.4.2 - 4.4.9
Array ( [0] => Array ( [0] => 354 [1] => <?php ) [1] => Array ( [0] => 305 [1] => public ) [2] => Array ( [0] => 357 [1] => ) [3] => Array ( [0] => 332 [1] => function ) [4] => Array ( [0] => 357 [1] => ) [5] => Array ( [0] => 305 [1] => enum ) [6] => ( [7] => Array ( [0] => 307 [1] => $value ) [8] => , [9] => Array ( [0] => 357 [1] => ) [10] => . [11] => . [12] => . [13] => Array ( [0] => 307 [1] => $items ) [14] => ) [15] => Array ( [0] => 357 [1] => ) [16] => { [17] => } )
Output for 4.3.0 - 4.4.1
Array ( [0] => Array ( [0] => 353 [1] => <?php ) [1] => Array ( [0] => 304 [1] => public ) [2] => Array ( [0] => 356 [1] => ) [3] => Array ( [0] => 331 [1] => function ) [4] => Array ( [0] => 356 [1] => ) [5] => Array ( [0] => 304 [1] => enum ) [6] => ( [7] => Array ( [0] => 306 [1] => $value ) [8] => , [9] => Array ( [0] => 356 [1] => ) [10] => . [11] => . [12] => . [13] => Array ( [0] => 306 [1] => $items ) [14] => ) [15] => Array ( [0] => 356 [1] => ) [16] => { [17] => } )