3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-Type: text/html; charset=UTF-8'); date_default_timezone_set('America/Los_Angeles'); echo memory_get_usage() . "\n"; $con = mysqli_connect("localhost", "***", "***", '***'); $result = mysqli_query($con,"SELECT * FROM **_streams"); while($row = mysqli_fetch_array($result)) { $json_array = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/'.strtolower($row['channel'])), true); if ($json_array['stream'] != NULL) { // turn them into variables to prevent outside SQL injection $displayname = mysqli_real_escape_string($con,$json_array['stream']['channel']['display_name']); $title = mysqli_real_escape_string($con,$json_array['stream']['channel']['status']); $game = mysqli_real_escape_string($con,$json_array['stream']['channel']['game']); $viewers = mysqli_real_escape_string($con,$json_array['stream']['viewers']); $preview = mysqli_real_escape_string($con,$json_array['stream']['preview']['medium']); $followers = mysqli_real_escape_string($con,$json_array['stream']['channel']['followers']); $date = date('m/d/Y h:i:s a', time()); mysqli_query($con,"SET NAMES utf8mb4"); mysqli_query($con,"UPDATE mybb_streams SET `online` = '1', `title` = '$title', `viewers` = '$viewers', `game` = '$game', `preview` = '$preview', `followers` = '$followers', `lastactive` = '$date' WHERE `channel` = '".strtolower($row['channel'])."'") or die("A MySQL error has occurred.<br />Your Query: UPDATE `streams` SET `online` = `1`, `title` = `$title`, `viewers` = `$viewers`, `game` = `$game`, `preview` = `$preview` WHERE channel = '".strtolower($row['channel'])."'<br /> Error: (" . mysqli_errno($con) . ") " . mysqli_error($con)); } else { mysqli_query($con,"UPDATE mybb_streams SET `online` = '0', `viewers` = '0' WHERE `channel` = '".strtolower($row['channel'])."'") or die("A MySQL error has occurred.<br />Your Query: UPDATE streams SET `online` = '0', `viewers` = '0' WHERE `channel` = '".strtolower($row['channel'])."'<br /> Error: (" . mysqli_errno($con) . ") " . mysqli_error($con)); } } echo memory_get_usage() . "\n"; ?>
Output for 7.3.0 - 7.3.1
397272 Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/3uQl4:7 Stack trace: #0 {main} thrown in /in/3uQl4 on line 7
Process exited with code 255.
Output for 7.2.0 - 7.2.13
395224 Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/3uQl4:7 Stack trace: #0 {main} thrown in /in/3uQl4 on line 7
Process exited with code 255.
Output for 7.1.0 - 7.1.1, 7.1.7 - 7.1.25
358552 Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/3uQl4:7 Stack trace: #0 {main} thrown in /in/3uQl4 on line 7
Process exited with code 255.
Output for 7.1.2 - 7.1.6
360392 Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/3uQl4:7 Stack trace: #0 {main} thrown in /in/3uQl4 on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.31
358504 Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /in/3uQl4:7 Stack trace: #0 {main} thrown in /in/3uQl4 on line 7
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.38
228816 Fatal error: Call to undefined function mysqli_connect() in /in/3uQl4 on line 7
Process exited with code 255.
Output for 5.4.10 - 5.4.45
229336 Fatal error: Call to undefined function mysqli_connect() in /in/3uQl4 on line 7
Process exited with code 255.
Output for 5.4.0 - 5.4.9
228808 Fatal error: Call to undefined function mysqli_connect() in /in/3uQl4 on line 7
Process exited with code 255.
Output for 5.3.11 - 5.3.29
642816 Fatal error: Call to undefined function mysqli_connect() in /in/3uQl4 on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.10
642512 Fatal error: Call to undefined function mysqli_connect() in /in/3uQl4 on line 7
Process exited with code 255.
Output for 5.2.10 - 5.2.17
100096 Fatal error: Call to undefined function mysqli_connect() in /in/3uQl4 on line 7
Process exited with code 255.
Output for 5.2.7 - 5.2.9
101216 Fatal error: Call to undefined function mysqli_connect() in /in/3uQl4 on line 7
Process exited with code 255.
Output for 5.2.3 - 5.2.6
101536 Fatal error: Call to undefined function mysqli_connect() in /in/3uQl4 on line 7
Process exited with code 255.
Output for 5.2.1 - 5.2.2
114632 Fatal error: Call to undefined function mysqli_connect() in /in/3uQl4 on line 7
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/3uQl4 on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/3uQl4 on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_set() in /in/3uQl4 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/3uQl4 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_set() in /in/3uQl4 on line 4

preferences:
164.54 ms | 401 KiB | 285 Q