3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php print_r(token_get_all(file_get_contents(__FILE__))); /*<?xml version="1.0" encoding="UTF-8"?>*/
based on rE408
Output for 7.0.0 - 7.2.0
Array ( [0] => Array ( [0] => 379 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 382 [1] => [2] => 2 ) [2] => Array ( [0] => 319 [1] => print_r [2] => 3 ) [3] => ( [4] => Array ( [0] => 319 [1] => token_get_all [2] => 3 ) [5] => ( [6] => Array ( [0] => 319 [1] => file_get_contents [2] => 3 ) [7] => ( [8] => Array ( [0] => 371 [1] => __FILE__ [2] => 3 ) [9] => ) [10] => ) [11] => ) [12] => ; [13] => Array ( [0] => 382 [1] => [2] => 3 ) [14] => Array ( [0] => 377 [1] => /*<?xml version="1.0" encoding="UTF-8"?>*/ [2] => 4 ) )
Output for 5.6.7 - 5.6.28
Array ( [0] => Array ( [0] => 376 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 379 [1] => [2] => 2 ) [2] => Array ( [0] => 310 [1] => print_r [2] => 3 ) [3] => ( [4] => Array ( [0] => 310 [1] => token_get_all [2] => 3 ) [5] => ( [6] => Array ( [0] => 310 [1] => file_get_contents [2] => 3 ) [7] => ( [8] => Array ( [0] => 373 [1] => __FILE__ [2] => 3 ) [9] => ) [10] => ) [11] => ) [12] => ; [13] => Array ( [0] => 379 [1] => [2] => 3 ) [14] => Array ( [0] => 374 [1] => /*<?xml version="1.0" encoding="UTF-8"?>*/ [2] => 4 ) )
Output for 5.5.24 - 5.5.35
Array ( [0] => Array ( [0] => 374 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 377 [1] => [2] => 2 ) [2] => Array ( [0] => 308 [1] => print_r [2] => 3 ) [3] => ( [4] => Array ( [0] => 308 [1] => token_get_all [2] => 3 ) [5] => ( [6] => Array ( [0] => 308 [1] => file_get_contents [2] => 3 ) [7] => ( [8] => Array ( [0] => 371 [1] => __FILE__ [2] => 3 ) [9] => ) [10] => ) [11] => ) [12] => ; [13] => Array ( [0] => 377 [1] => [2] => 3 ) [14] => Array ( [0] => 372 [1] => /*<?xml version="1.0" encoding="UTF-8"?>*/ [2] => 4 ) )
Output for 5.4.7 - 5.4.45
Array ( [0] => Array ( [0] => 372 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 375 [1] => [2] => 2 ) [2] => Array ( [0] => 307 [1] => print_r [2] => 3 ) [3] => ( [4] => Array ( [0] => 307 [1] => token_get_all [2] => 3 ) [5] => ( [6] => Array ( [0] => 307 [1] => file_get_contents [2] => 3 ) [7] => ( [8] => Array ( [0] => 369 [1] => __FILE__ [2] => 3 ) [9] => ) [10] => ) [11] => ) [12] => ; [13] => Array ( [0] => 375 [1] => [2] => 3 ) [14] => Array ( [0] => 370 [1] => /*<?xml version="1.0" encoding="UTF-8"?>*/ [2] => 4 ) )
Output for 5.3.17 - 5.3.29
Array ( [0] => Array ( [0] => 368 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 371 [1] => [2] => 2 ) [2] => Array ( [0] => 307 [1] => print_r [2] => 3 ) [3] => ( [4] => Array ( [0] => 307 [1] => token_get_all [2] => 3 ) [5] => ( [6] => Array ( [0] => 307 [1] => file_get_contents [2] => 3 ) [7] => ( [8] => Array ( [0] => 365 [1] => __FILE__ [2] => 3 ) [9] => ) [10] => ) [11] => ) [12] => ; [13] => Array ( [0] => 371 [1] => [2] => 3 ) [14] => Array ( [0] => 366 [1] => /*<?xml version="1.0" encoding="UTF-8"?>*/ [2] => 4 ) )