3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class WoWAPI{ /* Sadly, since the WoW API uses the same domain as the public site, Websense blocks it. Even the API calls are blocked. :( But, for the WoW fans, when you get home, go to http://us.battle.net/api/wow/character/" + YourRealm + "/" + YourCharacterName and be amazed! */ const HOST = 'http://us.battle.net'; public function __call($name, $args) { $url = self::HOST . '/api/wow'; //strip off get_ if (substr($name, 0, 3) == 'get') { $name = substr($name, 3); if (substr($name, 0, 1) == '_') { $name = substr($name, 1); } } //Slice the command up, and append the args $command = array_merge(explode('_', $name), $args); //construct the URL foreach ($command as $segment) { $url .= strtolower("/$segment"); } //send the get request and return the body //For the WoW API, everything returns as a JSON string. return http_parse_message(http_get($url))->body; }}$wowApi = new WoWAPI;echo $wowApi->getData_character('races');
Output for 5.4.0 - 5.4.31
Parse error: syntax error, unexpected end of file in /in/rtFgk on line 2
Process exited with code 255.
Output for 5.1.1 - 5.3.28
Parse error: syntax error, unexpected $end in /in/rtFgk on line 2
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/rtFgk on line 2
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected $ in /in/rtFgk on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/rtFgk on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/rtFgk on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/rtFgk on line 2
Process exited with code 255.