3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $code = '<?php class ABC extends Forbidden { function doIt() { $className = Forbidden::CLASS_NAME; Forbidden::$bla; Forbidden::doIt(); $x = new Forbidden(); $x->doItDynamic(); } }'; print_r(token_get_all($code));
Output for 7.0.0 - 7.1.0, 7.2.0
Array ( [0] => Array ( [0] => 379 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 361 [1] => class [2] => 2 ) [2] => Array ( [0] => 382 [1] => [2] => 2 ) [3] => Array ( [0] => 319 [1] => ABC [2] => 2 ) [4] => Array ( [0] => 382 [1] => [2] => 2 ) [5] => Array ( [0] => 364 [1] => extends [2] => 2 ) [6] => Array ( [0] => 382 [1] => [2] => 2 ) [7] => Array ( [0] => 319 [1] => Forbidden [2] => 2 ) [8] => Array ( [0] => 382 [1] => [2] => 2 ) [9] => { [10] => Array ( [0] => 382 [1] => [2] => 3 ) [11] => Array ( [0] => 346 [1] => function [2] => 4 ) [12] => Array ( [0] => 382 [1] => [2] => 4 ) [13] => Array ( [0] => 319 [1] => doIt [2] => 4 ) [14] => ( [15] => ) [16] => Array ( [0] => 382 [1] => [2] => 4 ) [17] => { [18] => Array ( [0] => 382 [1] => [2] => 5 ) [19] => Array ( [0] => 320 [1] => $className [2] => 6 ) [20] => Array ( [0] => 382 [1] => [2] => 6 ) [21] => = [22] => Array ( [0] => 382 [1] => [2] => 6 ) [23] => Array ( [0] => 319 [1] => Forbidden [2] => 6 ) [24] => Array ( [0] => 387 [1] => :: [2] => 6 ) [25] => Array ( [0] => 319 [1] => CLASS_NAME [2] => 6 ) [26] => ; [27] => Array ( [0] => 382 [1] => [2] => 6 ) [28] => Array ( [0] => 319 [1] => Forbidden [2] => 7 ) [29] => Array ( [0] => 387 [1] => :: [2] => 7 ) [30] => Array ( [0] => 320 [1] => $bla [2] => 7 ) [31] => ; [32] => Array ( [0] => 382 [1] => [2] => 7 ) [33] => Array ( [0] => 319 [1] => Forbidden [2] => 8 ) [34] => Array ( [0] => 387 [1] => :: [2] => 8 ) [35] => Array ( [0] => 319 [1] => doIt [2] => 8 ) [36] => ( [37] => ) [38] => ; [39] => Array ( [0] => 382 [1] => [2] => 8 ) [40] => Array ( [0] => 320 [1] => $x [2] => 9 ) [41] => Array ( [0] => 382 [1] => [2] => 9 ) [42] => = [43] => Array ( [0] => 382 [1] => [2] => 9 ) [44] => Array ( [0] => 305 [1] => new [2] => 9 ) [45] => Array ( [0] => 382 [1] => [2] => 9 ) [46] => Array ( [0] => 319 [1] => Forbidden [2] => 9 ) [47] => ( [48] => ) [49] => ; [50] => Array ( [0] => 382 [1] => [2] => 9 ) [51] => Array ( [0] => 320 [1] => $x [2] => 10 ) [52] => Array ( [0] => 366 [1] => -> [2] => 10 ) [53] => Array ( [0] => 319 [1] => doItDynamic [2] => 10 ) [54] => ( [55] => ) [56] => ; [57] => Array ( [0] => 382 [1] => [2] => 10 ) [58] => } [59] => Array ( [0] => 382 [1] => [2] => 11 ) [60] => } )
Output for 7.1.5 - 7.1.10
Array ( [0] => Array ( [0] => 379 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 361 [1] => class [2] => 2 ) [2] => Array ( [0] => 382 [1] => [2] => 2 ) [3] => Array ( [0] => 319 [1] => ABC [2] => 2 ) [4] => Array ( [0] => 382 [1] => [2] => 2 ) [5] => Array ( [0] => 364 [1] => extends [2] => 2 ) [6] => Array ( [0] => 382 [1] => [2] => 2 ) [7] => Array ( [0] => 319 [1] => Forbidden [2] => 2 ) [8] => Array ( [0] => 382 [1] => [2] => 2 ) [9] => { [10] => Array ( [0] => 382 [1] => [2] => 3 ) [11] => Array ( [0] => 346 [1] => function [2] => 4 ) [12] => Array ( [0] => 382 [1] => [2] => 4 ) [13] => Array ( [0] => 319 [1] => doIt [2] => 4 ) [14] => ( [15] => ) [16] => Array ( [0] => 382 [1] => [2] => 4 ) [17] => { [18] => Array ( [0] => 382 [1] => [2] => 5 ) [19] => Array ( [0] => 320 [1] => $className [2] => 6 ) [20] => Array ( [0] => 382 [1] => [2] => 6 ) [21] => = [22] => Array ( [0] => 382 [1] => [2] => 6 ) [23] => Array ( [0] => 319 [1] => Forbidden [2] => 6 ) [24] => Array ( [0] => 387 [1] => :: [2] => 6 ) [25] => Array ( [0] => 319 [1] => CLASS_NAME [2] => 6 ) [26] => ; [27] => Array ( [0] => 382 [1] => [2] => 6 ) [28] => Array ( [0] => 319 [1] => Forbidden [2] => 7 ) [29] => Array ( [0] => 387 [1] => :: [2] => 7 ) [30] => Array ( [0] => 320 [1] => $bla [2] => 7 ) [31] => ; [32] => Array ( [0] => 382 [1] => [2] => 7 ) [33] => Array ( [0] => 319 [1] => Forbidden [2] => 8 ) [34] => Array ( [0] => 387 [1] => :: [2] => 8 ) [35] => Array ( [0] => 319 [1] => doIt [2] => 8 ) [36] => ( [37] => ) [38] => ; [39] => Array ( [0] => 382 [1] => [2] => 8 ) [40] => Array ( [0] => 320 [1] => $x [2] => 9 ) [41] => Array ( [0] => 382 [1] => [2] => 9 ) [42] => = [43] => Array ( [0] => 382 [1] => [2] => 9 ) [44] => Array ( [0] => 306 [1] => new [2] => 9 ) [45] => Array ( [0] => 382 [1] => [2] => 9 ) [46] => Array ( [0] => 319 [1] => Forbidden [2] => 9 ) [47] => ( [48] => ) [49] => ; [50] => Array ( [0] => 382 [1] => [2] => 9 ) [51] => Array ( [0] => 320 [1] => $x [2] => 10 ) [52] => Array ( [0] => 366 [1] => -> [2] => 10 ) [53] => Array ( [0] => 319 [1] => doItDynamic [2] => 10 ) [54] => ( [55] => ) [56] => ; [57] => Array ( [0] => 382 [1] => [2] => 10 ) [58] => } [59] => Array ( [0] => 382 [1] => [2] => 11 ) [60] => } )
Output for 5.6.8 - 5.6.28
Array ( [0] => Array ( [0] => 376 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 358 [1] => class [2] => 2 ) [2] => Array ( [0] => 379 [1] => [2] => 2 ) [3] => Array ( [0] => 310 [1] => ABC [2] => 2 ) [4] => Array ( [0] => 379 [1] => [2] => 2 ) [5] => Array ( [0] => 361 [1] => extends [2] => 2 ) [6] => Array ( [0] => 379 [1] => [2] => 2 ) [7] => Array ( [0] => 310 [1] => Forbidden [2] => 2 ) [8] => Array ( [0] => 379 [1] => [2] => 2 ) [9] => { [10] => Array ( [0] => 379 [1] => [2] => 3 ) [11] => Array ( [0] => 337 [1] => function [2] => 4 ) [12] => Array ( [0] => 379 [1] => [2] => 4 ) [13] => Array ( [0] => 310 [1] => doIt [2] => 4 ) [14] => ( [15] => ) [16] => Array ( [0] => 379 [1] => [2] => 4 ) [17] => { [18] => Array ( [0] => 379 [1] => [2] => 5 ) [19] => Array ( [0] => 312 [1] => $className [2] => 6 ) [20] => Array ( [0] => 379 [1] => [2] => 6 ) [21] => = [22] => Array ( [0] => 379 [1] => [2] => 6 ) [23] => Array ( [0] => 310 [1] => Forbidden [2] => 6 ) [24] => Array ( [0] => 384 [1] => :: [2] => 6 ) [25] => Array ( [0] => 310 [1] => CLASS_NAME [2] => 6 ) [26] => ; [27] => Array ( [0] => 379 [1] => [2] => 6 ) [28] => Array ( [0] => 310 [1] => Forbidden [2] => 7 ) [29] => Array ( [0] => 384 [1] => :: [2] => 7 ) [30] => Array ( [0] => 312 [1] => $bla [2] => 7 ) [31] => ; [32] => Array ( [0] => 379 [1] => [2] => 7 ) [33] => Array ( [0] => 310 [1] => Forbidden [2] => 8 ) [34] => Array ( [0] => 384 [1] => :: [2] => 8 ) [35] => Array ( [0] => 310 [1] => doIt [2] => 8 ) [36] => ( [37] => ) [38] => ; [39] => Array ( [0] => 379 [1] => [2] => 8 ) [40] => Array ( [0] => 312 [1] => $x [2] => 9 ) [41] => Array ( [0] => 379 [1] => [2] => 9 ) [42] => = [43] => Array ( [0] => 379 [1] => [2] => 9 ) [44] => Array ( [0] => 302 [1] => new [2] => 9 ) [45] => Array ( [0] => 379 [1] => [2] => 9 ) [46] => Array ( [0] => 310 [1] => Forbidden [2] => 9 ) [47] => ( [48] => ) [49] => ; [50] => Array ( [0] => 379 [1] => [2] => 9 ) [51] => Array ( [0] => 312 [1] => $x [2] => 10 ) [52] => Array ( [0] => 363 [1] => -> [2] => 10 ) [53] => Array ( [0] => 310 [1] => doItDynamic [2] => 10 ) [54] => ( [55] => ) [56] => ; [57] => Array ( [0] => 379 [1] => [2] => 10 ) [58] => } [59] => Array ( [0] => 379 [1] => [2] => 11 ) [60] => } )
Output for 5.5.24 - 5.5.35
Array ( [0] => Array ( [0] => 374 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 356 [1] => class [2] => 2 ) [2] => Array ( [0] => 377 [1] => [2] => 2 ) [3] => Array ( [0] => 308 [1] => ABC [2] => 2 ) [4] => Array ( [0] => 377 [1] => [2] => 2 ) [5] => Array ( [0] => 359 [1] => extends [2] => 2 ) [6] => Array ( [0] => 377 [1] => [2] => 2 ) [7] => Array ( [0] => 308 [1] => Forbidden [2] => 2 ) [8] => Array ( [0] => 377 [1] => [2] => 2 ) [9] => { [10] => Array ( [0] => 377 [1] => [2] => 3 ) [11] => Array ( [0] => 335 [1] => function [2] => 4 ) [12] => Array ( [0] => 377 [1] => [2] => 4 ) [13] => Array ( [0] => 308 [1] => doIt [2] => 4 ) [14] => ( [15] => ) [16] => Array ( [0] => 377 [1] => [2] => 4 ) [17] => { [18] => Array ( [0] => 377 [1] => [2] => 5 ) [19] => Array ( [0] => 310 [1] => $className [2] => 6 ) [20] => Array ( [0] => 377 [1] => [2] => 6 ) [21] => = [22] => Array ( [0] => 377 [1] => [2] => 6 ) [23] => Array ( [0] => 308 [1] => Forbidden [2] => 6 ) [24] => Array ( [0] => 382 [1] => :: [2] => 6 ) [25] => Array ( [0] => 308 [1] => CLASS_NAME [2] => 6 ) [26] => ; [27] => Array ( [0] => 377 [1] => [2] => 6 ) [28] => Array ( [0] => 308 [1] => Forbidden [2] => 7 ) [29] => Array ( [0] => 382 [1] => :: [2] => 7 ) [30] => Array ( [0] => 310 [1] => $bla [2] => 7 ) [31] => ; [32] => Array ( [0] => 377 [1] => [2] => 7 ) [33] => Array ( [0] => 308 [1] => Forbidden [2] => 8 ) [34] => Array ( [0] => 382 [1] => :: [2] => 8 ) [35] => Array ( [0] => 308 [1] => doIt [2] => 8 ) [36] => ( [37] => ) [38] => ; [39] => Array ( [0] => 377 [1] => [2] => 8 ) [40] => Array ( [0] => 310 [1] => $x [2] => 9 ) [41] => Array ( [0] => 377 [1] => [2] => 9 ) [42] => = [43] => Array ( [0] => 377 [1] => [2] => 9 ) [44] => Array ( [0] => 300 [1] => new [2] => 9 ) [45] => Array ( [0] => 377 [1] => [2] => 9 ) [46] => Array ( [0] => 308 [1] => Forbidden [2] => 9 ) [47] => ( [48] => ) [49] => ; [50] => Array ( [0] => 377 [1] => [2] => 9 ) [51] => Array ( [0] => 310 [1] => $x [2] => 10 ) [52] => Array ( [0] => 361 [1] => -> [2] => 10 ) [53] => Array ( [0] => 308 [1] => doItDynamic [2] => 10 ) [54] => ( [55] => ) [56] => ; [57] => Array ( [0] => 377 [1] => [2] => 10 ) [58] => } [59] => Array ( [0] => 377 [1] => [2] => 11 ) [60] => } )
Output for 5.4.1 - 5.4.45
Array ( [0] => Array ( [0] => 372 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 354 [1] => class [2] => 2 ) [2] => Array ( [0] => 375 [1] => [2] => 2 ) [3] => Array ( [0] => 307 [1] => ABC [2] => 2 ) [4] => Array ( [0] => 375 [1] => [2] => 2 ) [5] => Array ( [0] => 357 [1] => extends [2] => 2 ) [6] => Array ( [0] => 375 [1] => [2] => 2 ) [7] => Array ( [0] => 307 [1] => Forbidden [2] => 2 ) [8] => Array ( [0] => 375 [1] => [2] => 2 ) [9] => { [10] => Array ( [0] => 375 [1] => [2] => 3 ) [11] => Array ( [0] => 334 [1] => function [2] => 4 ) [12] => Array ( [0] => 375 [1] => [2] => 4 ) [13] => Array ( [0] => 307 [1] => doIt [2] => 4 ) [14] => ( [15] => ) [16] => Array ( [0] => 375 [1] => [2] => 4 ) [17] => { [18] => Array ( [0] => 375 [1] => [2] => 5 ) [19] => Array ( [0] => 309 [1] => $className [2] => 6 ) [20] => Array ( [0] => 375 [1] => [2] => 6 ) [21] => = [22] => Array ( [0] => 375 [1] => [2] => 6 ) [23] => Array ( [0] => 307 [1] => Forbidden [2] => 6 ) [24] => Array ( [0] => 380 [1] => :: [2] => 6 ) [25] => Array ( [0] => 307 [1] => CLASS_NAME [2] => 6 ) [26] => ; [27] => Array ( [0] => 375 [1] => [2] => 6 ) [28] => Array ( [0] => 307 [1] => Forbidden [2] => 7 ) [29] => Array ( [0] => 380 [1] => :: [2] => 7 ) [30] => Array ( [0] => 309 [1] => $bla [2] => 7 ) [31] => ; [32] => Array ( [0] => 375 [1] => [2] => 7 ) [33] => Array ( [0] => 307 [1] => Forbidden [2] => 8 ) [34] => Array ( [0] => 380 [1] => :: [2] => 8 ) [35] => Array ( [0] => 307 [1] => doIt [2] => 8 ) [36] => ( [37] => ) [38] => ; [39] => Array ( [0] => 375 [1] => [2] => 8 ) [40] => Array ( [0] => 309 [1] => $x [2] => 9 ) [41] => Array ( [0] => 375 [1] => [2] => 9 ) [42] => = [43] => Array ( [0] => 375 [1] => [2] => 9 ) [44] => Array ( [0] => 299 [1] => new [2] => 9 ) [45] => Array ( [0] => 375 [1] => [2] => 9 ) [46] => Array ( [0] => 307 [1] => Forbidden [2] => 9 ) [47] => ( [48] => ) [49] => ; [50] => Array ( [0] => 375 [1] => [2] => 9 ) [51] => Array ( [0] => 309 [1] => $x [2] => 10 ) [52] => Array ( [0] => 359 [1] => -> [2] => 10 ) [53] => Array ( [0] => 307 [1] => doItDynamic [2] => 10 ) [54] => ( [55] => ) [56] => ; [57] => Array ( [0] => 375 [1] => [2] => 10 ) [58] => } [59] => Array ( [0] => 375 [1] => [2] => 11 ) [60] => } )
Output for 5.3.18 - 5.3.29
Array ( [0] => Array ( [0] => 368 [1] => <?php [2] => 1 ) [1] => Array ( [0] => 353 [1] => class [2] => 2 ) [2] => Array ( [0] => 371 [1] => [2] => 2 ) [3] => Array ( [0] => 307 [1] => ABC [2] => 2 ) [4] => Array ( [0] => 371 [1] => [2] => 2 ) [5] => Array ( [0] => 355 [1] => extends [2] => 2 ) [6] => Array ( [0] => 371 [1] => [2] => 2 ) [7] => Array ( [0] => 307 [1] => Forbidden [2] => 2 ) [8] => Array ( [0] => 371 [1] => [2] => 2 ) [9] => { [10] => Array ( [0] => 371 [1] => [2] => 3 ) [11] => Array ( [0] => 334 [1] => function [2] => 4 ) [12] => Array ( [0] => 371 [1] => [2] => 4 ) [13] => Array ( [0] => 307 [1] => doIt [2] => 4 ) [14] => ( [15] => ) [16] => Array ( [0] => 371 [1] => [2] => 4 ) [17] => { [18] => Array ( [0] => 371 [1] => [2] => 5 ) [19] => Array ( [0] => 309 [1] => $className [2] => 6 ) [20] => Array ( [0] => 371 [1] => [2] => 6 ) [21] => = [22] => Array ( [0] => 371 [1] => [2] => 6 ) [23] => Array ( [0] => 307 [1] => Forbidden [2] => 6 ) [24] => Array ( [0] => 376 [1] => :: [2] => 6 ) [25] => Array ( [0] => 307 [1] => CLASS_NAME [2] => 6 ) [26] => ; [27] => Array ( [0] => 371 [1] => [2] => 6 ) [28] => Array ( [0] => 307 [1] => Forbidden [2] => 7 ) [29] => Array ( [0] => 376 [1] => :: [2] => 7 ) [30] => Array ( [0] => 309 [1] => $bla [2] => 7 ) [31] => ; [32] => Array ( [0] => 371 [1] => [2] => 7 ) [33] => Array ( [0] => 307 [1] => Forbidden [2] => 8 ) [34] => Array ( [0] => 376 [1] => :: [2] => 8 ) [35] => Array ( [0] => 307 [1] => doIt [2] => 8 ) [36] => ( [37] => ) [38] => ; [39] => Array ( [0] => 371 [1] => [2] => 8 ) [40] => Array ( [0] => 309 [1] => $x [2] => 9 ) [41] => Array ( [0] => 371 [1] => [2] => 9 ) [42] => = [43] => Array ( [0] => 371 [1] => [2] => 9 ) [44] => Array ( [0] => 299 [1] => new [2] => 9 ) [45] => Array ( [0] => 371 [1] => [2] => 9 ) [46] => Array ( [0] => 307 [1] => Forbidden [2] => 9 ) [47] => ( [48] => ) [49] => ; [50] => Array ( [0] => 371 [1] => [2] => 9 ) [51] => Array ( [0] => 309 [1] => $x [2] => 10 ) [52] => Array ( [0] => 357 [1] => -> [2] => 10 ) [53] => Array ( [0] => 307 [1] => doItDynamic [2] => 10 ) [54] => ( [55] => ) [56] => ; [57] => Array ( [0] => 371 [1] => [2] => 10 ) [58] => } [59] => Array ( [0] => 371 [1] => [2] => 11 ) [60] => } )