3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $code = ' <?php $x = 4; $x **= 2; '; $tokens = token_get_all($code); var_dump($tokens);
based on ZVvgt
Output for 7.0.0 - 7.1.0, 7.2.0
array(16) { [0]=> array(3) { [0]=> int(321) [1]=> string(1) " " [2]=> int(1) } [1]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(2) } [2]=> array(3) { [0]=> int(320) [1]=> string(2) "$x" [2]=> int(3) } [3]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [4]=> string(1) "=" [5]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [6]=> array(3) { [0]=> int(317) [1]=> string(1) "4" [2]=> int(3) } [7]=> string(1) ";" [8]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(320) [1]=> string(2) "$x" [2]=> int(4) } [10]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [11]=> array(3) { [0]=> int(281) [1]=> string(3) "**=" [2]=> int(4) } [12]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [13]=> array(3) { [0]=> int(317) [1]=> string(1) "2" [2]=> int(4) } [14]=> string(1) ";" [15]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } }
Output for 7.1.5 - 7.1.10
array(16) { [0]=> array(3) { [0]=> int(321) [1]=> string(1) " " [2]=> int(1) } [1]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(2) } [2]=> array(3) { [0]=> int(320) [1]=> string(2) "$x" [2]=> int(3) } [3]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [4]=> string(1) "=" [5]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [6]=> array(3) { [0]=> int(317) [1]=> string(1) "4" [2]=> int(3) } [7]=> string(1) ";" [8]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(320) [1]=> string(2) "$x" [2]=> int(4) } [10]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [11]=> array(3) { [0]=> int(270) [1]=> string(3) "**=" [2]=> int(4) } [12]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } [13]=> array(3) { [0]=> int(317) [1]=> string(1) "2" [2]=> int(4) } [14]=> string(1) ";" [15]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(4) } }
Output for 5.6.8 - 5.6.28
array(16) { [0]=> array(3) { [0]=> int(314) [1]=> string(1) " " [2]=> int(1) } [1]=> array(3) { [0]=> int(376) [1]=> string(6) "<?php " [2]=> int(2) } [2]=> array(3) { [0]=> int(312) [1]=> string(2) "$x" [2]=> int(3) } [3]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(3) } [4]=> string(1) "=" [5]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(3) } [6]=> array(3) { [0]=> int(308) [1]=> string(1) "4" [2]=> int(3) } [7]=> string(1) ";" [8]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(312) [1]=> string(2) "$x" [2]=> int(4) } [10]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(4) } [11]=> array(3) { [0]=> int(268) [1]=> string(3) "**=" [2]=> int(4) } [12]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(4) } [13]=> array(3) { [0]=> int(308) [1]=> string(1) "2" [2]=> int(4) } [14]=> string(1) ";" [15]=> array(3) { [0]=> int(379) [1]=> string(1) " " [2]=> int(4) } }
Output for 5.5.24 - 5.5.35
array(17) { [0]=> array(3) { [0]=> int(312) [1]=> string(1) " " [2]=> int(1) } [1]=> array(3) { [0]=> int(374) [1]=> string(6) "<?php " [2]=> int(2) } [2]=> array(3) { [0]=> int(310) [1]=> string(2) "$x" [2]=> int(3) } [3]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(3) } [4]=> string(1) "=" [5]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(3) } [6]=> array(3) { [0]=> int(306) [1]=> string(1) "4" [2]=> int(3) } [7]=> string(1) ";" [8]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(310) [1]=> string(2) "$x" [2]=> int(4) } [10]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(4) } [11]=> string(1) "*" [12]=> array(3) { [0]=> int(276) [1]=> string(2) "*=" [2]=> int(4) } [13]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(4) } [14]=> array(3) { [0]=> int(306) [1]=> string(1) "2" [2]=> int(4) } [15]=> string(1) ";" [16]=> array(3) { [0]=> int(377) [1]=> string(1) " " [2]=> int(4) } }
Output for 5.4.11 - 5.4.45
array(17) { [0]=> array(3) { [0]=> int(311) [1]=> string(1) " " [2]=> int(1) } [1]=> array(3) { [0]=> int(372) [1]=> string(6) "<?php " [2]=> int(2) } [2]=> array(3) { [0]=> int(309) [1]=> string(2) "$x" [2]=> int(3) } [3]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(3) } [4]=> string(1) "=" [5]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(3) } [6]=> array(3) { [0]=> int(305) [1]=> string(1) "4" [2]=> int(3) } [7]=> string(1) ";" [8]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(309) [1]=> string(2) "$x" [2]=> int(4) } [10]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(4) } [11]=> string(1) "*" [12]=> array(3) { [0]=> int(275) [1]=> string(2) "*=" [2]=> int(4) } [13]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(4) } [14]=> array(3) { [0]=> int(305) [1]=> string(1) "2" [2]=> int(4) } [15]=> string(1) ";" [16]=> array(3) { [0]=> int(375) [1]=> string(1) " " [2]=> int(4) } }
Output for 5.3.21 - 5.3.29
array(17) { [0]=> array(3) { [0]=> int(311) [1]=> string(1) " " [2]=> int(1) } [1]=> array(3) { [0]=> int(368) [1]=> string(6) "<?php " [2]=> int(2) } [2]=> array(3) { [0]=> int(309) [1]=> string(2) "$x" [2]=> int(3) } [3]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(3) } [4]=> string(1) "=" [5]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(3) } [6]=> array(3) { [0]=> int(305) [1]=> string(1) "4" [2]=> int(3) } [7]=> string(1) ";" [8]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(3) } [9]=> array(3) { [0]=> int(309) [1]=> string(2) "$x" [2]=> int(4) } [10]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(4) } [11]=> string(1) "*" [12]=> array(3) { [0]=> int(275) [1]=> string(2) "*=" [2]=> int(4) } [13]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(4) } [14]=> array(3) { [0]=> int(305) [1]=> string(1) "2" [2]=> int(4) } [15]=> string(1) ";" [16]=> array(3) { [0]=> int(371) [1]=> string(1) " " [2]=> int(4) } }