3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tokens = token_get_all('<?php $a=1;echo $a; ?>'); // => array(array(T_INLINE_HTML, '/* comment */')); var_dump($tokens);
Output for 8.4.1 - 8.4.2
array(11) { [0]=> array(3) { [0]=> int(393) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(266) [1]=> string(2) "$a" [2]=> int(1) } [2]=> string(1) "=" [3]=> array(3) { [0]=> int(260) [1]=> string(1) "1" [2]=> int(1) } [4]=> string(1) ";" [5]=> array(3) { [0]=> int(291) [1]=> string(4) "echo" [2]=> int(1) } [6]=> array(3) { [0]=> int(396) [1]=> string(1) " " [2]=> int(1) } [7]=> array(3) { [0]=> int(266) [1]=> string(2) "$a" [2]=> int(1) } [8]=> string(1) ";" [9]=> array(3) { [0]=> int(396) [1]=> string(1) " " [2]=> int(1) } [10]=> array(3) { [0]=> int(395) [1]=> string(2) "?>" [2]=> int(1) } }
Output for 8.3.0, 8.3.2, 8.3.4, 8.3.7, 8.3.9, 8.3.11, 8.3.13, 8.3.15
array(11) { [0]=> array(3) { [0]=> int(394) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(317) [1]=> string(2) "$a" [2]=> int(1) } [2]=> string(1) "=" [3]=> array(3) { [0]=> int(311) [1]=> string(1) "1" [2]=> int(1) } [4]=> string(1) ";" [5]=> array(3) { [0]=> int(328) [1]=> string(4) "echo" [2]=> int(1) } [6]=> array(3) { [0]=> int(397) [1]=> string(1) " " [2]=> int(1) } [7]=> array(3) { [0]=> int(317) [1]=> string(2) "$a" [2]=> int(1) } [8]=> string(1) ";" [9]=> array(3) { [0]=> int(397) [1]=> string(1) " " [2]=> int(1) } [10]=> array(3) { [0]=> int(396) [1]=> string(2) "?>" [2]=> int(1) } }
Output for 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.1, 8.3.3, 8.3.6, 8.3.8, 8.3.10, 8.3.12, 8.3.14
array(11) { [0]=> array(3) { [0]=> int(389) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(266) [1]=> string(2) "$a" [2]=> int(1) } [2]=> string(1) "=" [3]=> array(3) { [0]=> int(260) [1]=> string(1) "1" [2]=> int(1) } [4]=> string(1) ";" [5]=> array(3) { [0]=> int(291) [1]=> string(4) "echo" [2]=> int(1) } [6]=> array(3) { [0]=> int(392) [1]=> string(1) " " [2]=> int(1) } [7]=> array(3) { [0]=> int(266) [1]=> string(2) "$a" [2]=> int(1) } [8]=> string(1) ";" [9]=> array(3) { [0]=> int(392) [1]=> string(1) " " [2]=> int(1) } [10]=> array(3) { [0]=> int(391) [1]=> string(2) "?>" [2]=> int(1) } }
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 array(11) { [0]=> array(3) { [0]=> int(389) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(266) [1]=> string(2) "$a" [2]=> int(1) } [2]=> string(1) "=" [3]=> array(3) { [0]=> int(260) [1]=> string(1) "1" [2]=> int(1) } [4]=> string(1) ";" [5]=> array(3) { [0]=> int(291) [1]=> string(4) "echo" [2]=> int(1) } [6]=> array(3) { [0]=> int(392) [1]=> string(1) " " [2]=> int(1) } [7]=> array(3) { [0]=> int(266) [1]=> string(2) "$a" [2]=> int(1) } [8]=> string(1) ";" [9]=> array(3) { [0]=> int(392) [1]=> string(1) " " [2]=> int(1) } [10]=> array(3) { [0]=> int(391) [1]=> string(2) "?>" [2]=> int(1) } }
Output for 8.0.30
array(11) { [0]=> array(3) { [0]=> int(387) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(266) [1]=> string(2) "$a" [2]=> int(1) } [2]=> string(1) "=" [3]=> array(3) { [0]=> int(260) [1]=> string(1) "1" [2]=> int(1) } [4]=> string(1) ";" [5]=> array(3) { [0]=> int(291) [1]=> string(4) "echo" [2]=> int(1) } [6]=> array(3) { [0]=> int(390) [1]=> string(1) " " [2]=> int(1) } [7]=> array(3) { [0]=> int(266) [1]=> string(2) "$a" [2]=> int(1) } [8]=> string(1) ";" [9]=> array(3) { [0]=> int(390) [1]=> string(1) " " [2]=> int(1) } [10]=> array(3) { [0]=> int(389) [1]=> string(2) "?>" [2]=> int(1) } }
Output for 8.0.0 - 8.0.29
array(11) { [0]=> array(3) { [0]=> int(390) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(315) [1]=> string(2) "$a" [2]=> int(1) } [2]=> string(1) "=" [3]=> array(3) { [0]=> int(309) [1]=> string(1) "1" [2]=> int(1) } [4]=> string(1) ";" [5]=> array(3) { [0]=> int(326) [1]=> string(4) "echo" [2]=> int(1) } [6]=> array(3) { [0]=> int(393) [1]=> string(1) " " [2]=> int(1) } [7]=> array(3) { [0]=> int(315) [1]=> string(2) "$a" [2]=> int(1) } [8]=> string(1) ";" [9]=> array(3) { [0]=> int(393) [1]=> string(1) " " [2]=> int(1) } [10]=> array(3) { [0]=> int(392) [1]=> string(2) "?>" [2]=> int(1) } }
Output for 7.4.0 - 7.4.33
array(11) { [0]=> array(3) { [0]=> int(382) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(312) [1]=> string(2) "$a" [2]=> int(1) } [2]=> string(1) "=" [3]=> array(3) { [0]=> int(309) [1]=> string(1) "1" [2]=> int(1) } [4]=> string(1) ";" [5]=> array(3) { [0]=> int(324) [1]=> string(4) "echo" [2]=> int(1) } [6]=> array(3) { [0]=> int(385) [1]=> string(1) " " [2]=> int(1) } [7]=> array(3) { [0]=> int(312) [1]=> string(2) "$a" [2]=> int(1) } [8]=> string(1) ";" [9]=> array(3) { [0]=> int(385) [1]=> string(1) " " [2]=> int(1) } [10]=> array(3) { [0]=> int(384) [1]=> string(2) "?>" [2]=> int(1) } }
Output for 7.3.0 - 7.3.33
array(11) { [0]=> array(3) { [0]=> int(379) [1]=> string(6) "<?php " [2]=> int(1) } [1]=> array(3) { [0]=> int(320) [1]=> string(2) "$a" [2]=> int(1) } [2]=> string(1) "=" [3]=> array(3) { [0]=> int(317) [1]=> string(1) "1" [2]=> int(1) } [4]=> string(1) ";" [5]=> array(3) { [0]=> int(328) [1]=> string(4) "echo" [2]=> int(1) } [6]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [7]=> array(3) { [0]=> int(320) [1]=> string(2) "$a" [2]=> int(1) } [8]=> string(1) ";" [9]=> array(3) { [0]=> int(382) [1]=> string(1) " " [2]=> int(1) } [10]=> array(3) { [0]=> int(381) [1]=> string(2) "?>" [2]=> int(1) } }

preferences:
89.77 ms | 424 KiB | 5 Q