3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = "<?php\n class test{}\n someclasss::method('Class not found');"; var_dump( T_CLASS ); var_dump( json_encode(token_get_all( $str ) ));
Output for 7.0.0 - 7.1.0
int(361) string(189) "[[379,"<?php\n",1],[382,"\n",2],[361,"class",3],[382," ",3],[319,"test",3],"{","}",[382,"\n\n",3],[319,"someclasss",5],[387,"::",5],[319,"method",5],"(",[323,"'Class not found'",5],")",";"]"
Output for hhvm-3.10.0 - 3.12.0
int(353) string(189) "[[368,"<?php\n",1],[371,"\n",2],[353,"class",3],[371," ",3],[307,"test",3],"{","}",[371,"\n\n",3],[307,"someclasss",5],[426,"::",5],[307,"method",5],"(",[315,"'Class not found'",5],")",";"]"
Output for 5.6.0 - 5.6.28
int(358) string(189) "[[376,"<?php\n",1],[379,"\n",2],[358,"class",3],[379," ",3],[310,"test",3],"{","}",[379,"\n\n",3],[310,"someclasss",5],[384,"::",5],[310,"method",5],"(",[318,"'Class not found'",5],")",";"]"
Output for 5.5.0 - 5.5.37
int(356) string(189) "[[374,"<?php\n",1],[377,"\n",2],[356,"class",3],[377," ",3],[308,"test",3],"{","}",[377,"\n\n",3],[308,"someclasss",5],[382,"::",5],[308,"method",5],"(",[316,"'Class not found'",5],")",";"]"
Output for 5.4.0 - 5.4.45
int(354) string(189) "[[372,"<?php\n",1],[375,"\n",2],[354,"class",3],[375," ",3],[307,"test",3],"{","}",[375,"\n\n",3],[307,"someclasss",5],[380,"::",5],[307,"method",5],"(",[315,"'Class not found'",5],")",";"]"
Output for 5.3.0 - 5.3.29
int(353) string(189) "[[368,"<?php\n",1],[371,"\n",2],[353,"class",3],[371," ",3],[307,"test",3],"{","}",[371,"\n\n",3],[307,"someclasss",5],[376,"::",5],[307,"method",5],"(",[315,"'Class not found'",5],")",";"]"
Output for 5.2.2 - 5.2.17
int(352) string(189) "[[367,"<?php\n",1],[370,"\n",2],[352,"class",3],[370," ",3],[307,"test",3],"{","}",[370,"\n\n",3],[307,"someclasss",5],[375,"::",5],[307,"method",5],"(",[315,"'Class not found'",5],")",";"]"
Output for 5.2.0 - 5.2.1
int(352) string(169) "[[367,"<?php\n"],[370,"\n"],[352,"class"],[370," "],[307,"test"],"{","}",[370,"\n\n"],[307,"someclasss"],[375,"::"],[307,"method"],"(",[315,"'Class not found'"],")",";"]"
Output for 5.1.0 - 5.1.6
int(352) Fatal error: Call to undefined function json_encode() in /in/342S4 on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.5
int(350) Fatal error: Call to undefined function json_encode() in /in/342S4 on line 8
Process exited with code 255.
Output for 4.4.5 - 4.4.9
int(342) Fatal error: Call to undefined function: json_encode() in /in/342S4 on line 8
Process exited with code 255.
Output for 4.4.2 - 4.4.4
int(342) Fatal error: Call to undefined function: json_encode() in /in/342S4 on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.1
int(341) Fatal error: Call to undefined function: json_encode() in /in/342S4 on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
int(341) Fatal error: Call to undefined function: json_encode() in /in/342S4 on line 8