3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // include the tmdb class include('tmdb.php'); //if you prefer using 'xml' $tmdb_xml = new TMDb('YOUR_API_KEY_HERE', TMDb::XML); //Title to search for $title = $_POST['title']; //Search Movie with default return format $xml_movies_result = $tmdb_xml->searchMovie($title); $xml = simplexml_load_string($xml_movies_result); echo '<table>'; echo '<tr>'; echo '<th>Cover</th>'; echo '<th>Info</th>'; echo '</tr>'; foreach ($xml->movies->movie as $movie) { $moviename = $movie->name; $imdbid = $movie->imdb_id; $posterimg = $movie->images->image[3]['url']; echo '<tr>'; if (!empty($posterimg)) { echo '<td><a target="_blank" href="'.$movie->url.'"></a></td>'; } else { echo '<td>No image</td>'; } echo '<td><a target="_blank" href="'.$movie->url.'"><strong>'.$moviename.'</strong></a> ('.substr($movie->released, 0, 4).')<br /><br />'; echo $movie->overview; echo '</td>'; echo '</tr>'; } echo '</table>'; ?>
Output for 7.0.0 - 7.1.0
Warning: include(tmdb.php): failed to open stream: No such file or directory in /in/qvEHS on line 3 Warning: include(): Failed opening 'tmdb.php' for inclusion (include_path='.:') in /in/qvEHS on line 3 Fatal error: Uncaught Error: Class 'TMDb' not found in /in/qvEHS:7 Stack trace: #0 {main} thrown in /in/qvEHS on line 7
Process exited with code 255.
Output for hhvm-3.12.0
Warning: File not found: tmdb.php in /in/qvEHS on line 3 Fatal error: Uncaught Error: Class undefined: TMDb in /in/qvEHS:7 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Warning: File not found: tmdb.php in /in/qvEHS on line 3 Fatal error: Class undefined: TMDb in /in/qvEHS on line 7
Process exited with code 255.
Output for 5.1.0 - 5.6.28
Warning: include(tmdb.php): failed to open stream: No such file or directory in /in/qvEHS on line 3 Warning: include(): Failed opening 'tmdb.php' for inclusion (include_path='.:') in /in/qvEHS on line 3 Fatal error: Class 'TMDb' not found in /in/qvEHS on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: main(tmdb.php): failed to open stream: No such file or directory in /in/qvEHS on line 3 Warning: main(): Failed opening 'tmdb.php' for inclusion (include_path='.:') in /in/qvEHS on line 3 Fatal error: Class 'TMDb' not found in /in/qvEHS on line 7
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')', expecting '(' in /in/qvEHS on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected ')', expecting '(' in /in/qvEHS on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/qvEHS on line 7
Process exited with code 255.