3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $code ='<?php function test($a) { echo $a; } $a = 10; test($a); ?>'; $tokens = token_get_all($code); foreach ($tokens as $row) { if (is_numeric($row[0])) { echo token_name($row[0]), "\r\n"; } }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
T_OPEN_TAG T_FUNCTION T_WHITESPACE T_STRING T_VARIABLE T_WHITESPACE T_WHITESPACE T_ECHO T_WHITESPACE T_VARIABLE T_WHITESPACE T_WHITESPACE T_VARIABLE T_WHITESPACE T_WHITESPACE T_LNUMBER T_WHITESPACE T_STRING T_VARIABLE T_WHITESPACE T_CLOSE_TAG