3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = '<?php public function enum($value, ...$items) {}'; $tokens = token_get_all($string); print_r($tokens);
based on Do8JP

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
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 Array change keys
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 Lexical anon
Array ( [0] => Array ( [0] => 377 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 314 [1] => public [2] => 1 ) [2] => Array ( [0] => 380 [1] => [2] => 1 ) [3] => Array ( [0] => 344 [1] => function [2] => 1 ) [4] => Array ( [0] => 380 [1] => [2] => 1 ) [5] => Array ( [0] => 317 [1] => enum [2] => 1 ) [6] => ( [7] => Array ( [0] => 318 [1] => $value [2] => 1 ) [8] => , [9] => Array ( [0] => 380 [1] => [2] => 1 ) [10] => Array ( [0] => 389 [1] => ... [2] => 1 ) [11] => Array ( [0] => 318 [1] => $items [2] => 1 ) [12] => ) [13] => Array ( [0] => 380 [1] => [2] => 1 ) [14] => { [15] => } )

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page