3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tokens = token_get_all('<?php $a = 1 + 2; echo $a ?>'); foreach($tokens as $token) { var_dump($token); echo token_name($token[0]); }
Output for git.master, git.master_jit
array(3) { [0]=> int(394) [1]=> string(6) "<?php " [2]=> int(1) } T_OPEN_TAGarray(3) { [0]=> int(317) [1]=> string(2) "$a" [2]=> int(1) } T_VARIABLEarray(3) { [0]=> int(397) [1]=> string(1) " " [2]=> int(1) } T_WHITESPACEstring(1) "=" Fatal error: Uncaught TypeError: token_name(): Argument #1 ($id) must be of type int, string given in /in/dN9Bs:7 Stack trace: #0 /in/dN9Bs(7): token_name('=') #1 {main} thrown in /in/dN9Bs on line 7
Process exited with code 255.
Output for rfc.property-hooks
array(3) { [0]=> int(396) [1]=> string(6) "<?php " [2]=> int(1) } T_OPEN_TAGarray(3) { [0]=> int(317) [1]=> string(2) "$a" [2]=> int(1) } T_VARIABLEarray(3) { [0]=> int(399) [1]=> string(1) " " [2]=> int(1) } T_WHITESPACEstring(1) "=" Fatal error: Uncaught TypeError: token_name(): Argument #1 ($id) must be of type int, string given in /in/dN9Bs:7 Stack trace: #0 /in/dN9Bs(7): token_name('=') #1 {main} thrown in /in/dN9Bs on line 7
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
39.69 ms | 401 KiB | 8 Q