3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tokens = token_get_all('<?php $a = 1 + 2; echo $a ?>'); foreach($tokens as $token) { if(is_array(token)) { echo token_name($token[0]); } else { echo $token; } }
Output for 5.4.0 - 7.1.0
Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 = Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 + Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 ; Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Notice: Array to string conversion in /in/WRofu on line 9 Array
Output for 4.3.0 - 5.3.29
Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 = Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 + Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 ; Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array Notice: Use of undefined constant token - assumed 'token' in /in/WRofu on line 6 Array