3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tokens = token_get_all('<?php echo; ?>'); print_r($tokens); $tokens = token_get_all('/* comment */'); print_r($tokens);
Output for 7.0.0 - 7.1.0
Array ( [0] => Array ( [0] => 379 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 328 [1] => echo [2] => 1 ) [2] => ; [3] => Array ( [0] => 382 [1] => [2] => 1 ) [4] => Array ( [0] => 381 [1] => ?> [2] => 1 ) ) Array ( [0] => Array ( [0] => 321 [1] => /* comment */ [2] => 1 ) )
Output for 5.3.0 - 5.3.29, hhvm-3.10.0 - 3.12.0
Array ( [0] => Array ( [0] => 368 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 316 [1] => echo [2] => 1 ) [2] => ; [3] => Array ( [0] => 371 [1] => [2] => 1 ) [4] => Array ( [0] => 370 [1] => ?> [2] => 1 ) ) Array ( [0] => Array ( [0] => 311 [1] => /* comment */ [2] => 1 ) )
Output for 5.6.0 - 5.6.28
Array ( [0] => Array ( [0] => 376 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 319 [1] => echo [2] => 1 ) [2] => ; [3] => Array ( [0] => 379 [1] => [2] => 1 ) [4] => Array ( [0] => 378 [1] => ?> [2] => 1 ) ) Array ( [0] => Array ( [0] => 314 [1] => /* comment */ [2] => 1 ) )
Output for 5.5.0 - 5.5.37
Array ( [0] => Array ( [0] => 374 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 317 [1] => echo [2] => 1 ) [2] => ; [3] => Array ( [0] => 377 [1] => [2] => 1 ) [4] => Array ( [0] => 376 [1] => ?> [2] => 1 ) ) Array ( [0] => Array ( [0] => 312 [1] => /* comment */ [2] => 1 ) )
Output for 5.4.0 - 5.4.45
Array ( [0] => Array ( [0] => 372 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 316 [1] => echo [2] => 1 ) [2] => ; [3] => Array ( [0] => 375 [1] => [2] => 1 ) [4] => Array ( [0] => 374 [1] => ?> [2] => 1 ) ) Array ( [0] => Array ( [0] => 311 [1] => /* comment */ [2] => 1 ) )
Output for 5.2.2 - 5.2.17
Array ( [0] => Array ( [0] => 367 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 316 [1] => echo [2] => 1 ) [2] => ; [3] => Array ( [0] => 370 [1] => [2] => 1 ) [4] => Array ( [0] => 369 [1] => ?> [2] => 1 ) ) Array ( [0] => Array ( [0] => 311 [1] => /* comment */ [2] => 1 ) )
Output for 5.1.0 - 5.2.1
Array ( [0] => Array ( [0] => 367 [1] => <?php ) [1] => Array ( [0] => 316 [1] => echo ) [2] => ; [3] => Array ( [0] => 370 [1] => ) [4] => Array ( [0] => 369 [1] => ?> ) ) Array ( [0] => Array ( [0] => 311 [1] => /* comment */ ) )
Output for 5.0.0 - 5.0.5
Array ( [0] => Array ( [0] => 365 [1] => <?php ) [1] => Array ( [0] => 315 [1] => echo ) [2] => ; [3] => Array ( [0] => 368 [1] => ) [4] => Array ( [0] => 367 [1] => ?> ) ) Array ( [0] => Array ( [0] => 310 [1] => /* comment */ ) )
Output for 4.4.2 - 4.4.9
Array ( [0] => Array ( [0] => 354 [1] => <?php ) [1] => Array ( [0] => 314 [1] => echo ) [2] => ; [3] => Array ( [0] => 357 [1] => ) [4] => Array ( [0] => 356 [1] => ?> ) ) Array ( [0] => Array ( [0] => 309 [1] => /* comment */ ) )
Output for 4.3.0 - 4.4.1
Array ( [0] => Array ( [0] => 353 [1] => <?php ) [1] => Array ( [0] => 313 [1] => echo ) [2] => ; [3] => Array ( [0] => 356 [1] => ) [4] => Array ( [0] => 355 [1] => ?> ) ) Array ( [0] => Array ( [0] => 308 [1] => /* comment */ ) )