3v4l.org

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