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"; ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.3.10.0030.01216.61
7.3.00.0030.01016.63
7.2.130.0040.00716.64
7.2.120.0080.00416.75
7.2.110.0030.01316.76
7.2.100.0100.00416.51
7.2.90.0390.01116.77
7.2.80.0130.00316.70
7.2.70.0110.00716.66
7.2.60.0120.00316.88
7.2.50.0120.00516.78
7.2.40.0110.00916.84
7.2.30.0070.00816.78
7.2.20.0110.00316.70
7.2.10.0110.00316.79
7.2.00.0100.00516.88
7.1.250.0000.00815.80
7.1.230.0080.00815.57
7.1.220.0170.00615.61
7.1.210.0110.01115.65
7.1.200.0030.00915.74
7.1.190.0120.00815.35
7.1.180.0120.00415.64
7.1.170.0220.00415.56
7.1.160.0130.00315.86
7.1.150.0140.01015.65
7.1.140.0290.00615.77
7.1.130.0120.00615.33
7.1.120.0140.00015.66
7.1.110.0130.00615.87
7.1.100.0050.00915.64
7.1.90.0100.00815.61
7.1.80.0140.00315.71
7.1.70.0080.01016.34
7.1.60.0170.00517.48
7.1.50.0060.01716.19
7.1.40.0110.00716.00
7.1.30.0080.00915.61
7.1.20.0180.00415.92
7.1.10.0100.00615.46
7.1.00.0080.04018.99
7.0.310.0140.01415.38
7.0.300.0100.01015.12
7.0.290.0160.00315.21
7.0.280.0110.00415.22
7.0.270.0120.00315.23
7.0.260.0360.00715.40
7.0.250.0090.00615.47
7.0.240.0110.00415.48
7.0.230.0090.00915.20
7.0.220.0430.00715.44
7.0.210.0150.00015.32
7.0.200.0180.00415.90
7.0.190.0150.00515.39
7.0.180.0120.00315.33
7.0.170.0040.01115.48
7.0.160.0140.00015.36
7.0.150.0110.00415.39
7.0.140.0020.04418.54
7.0.130.0120.00315.26
7.0.120.0670.00615.13
7.0.110.0110.00715.21
7.0.100.0050.01115.50
7.0.90.0110.00615.11
7.0.80.0100.04617.63
7.0.70.0090.04117.73
7.0.60.0140.03017.65
7.0.50.0110.03417.85
7.0.40.0120.04216.69
7.0.30.0120.04316.85
7.0.20.0120.03716.66
7.0.10.0120.03816.84
7.0.00.0100.04216.58
5.6.380.0070.01014.09
5.6.370.0040.01114.28
5.6.360.0130.00414.25
5.6.350.0110.00614.24
5.6.340.0090.00914.37
5.6.330.0080.00814.03
5.6.320.0100.00314.14
5.6.310.0040.01213.90
5.6.300.0130.00414.21
5.6.290.0090.00914.34
5.6.280.0090.03817.64
5.6.270.0100.01014.46
5.6.260.0050.00514.29
5.6.250.0120.00314.43
5.6.240.0110.00614.25
5.6.230.0060.03517.55
5.6.220.0090.02317.48
5.6.210.0130.01817.58
5.6.200.0090.04317.71
5.6.190.0110.04117.59
5.6.180.0100.04017.58
5.6.170.0080.03917.61
5.6.160.0130.04117.76
5.6.150.0070.02717.57
5.6.140.0100.04317.66
5.6.130.0120.04517.50
5.6.120.0130.02217.65
5.6.110.0100.04517.78
5.6.100.0100.04517.59
5.6.90.0100.03217.80
5.6.80.0110.02217.38
5.6.70.0070.04017.27
5.6.60.0080.04117.29
5.6.50.0070.04517.12
5.6.40.0100.02217.24
5.6.30.0070.02517.33
5.6.20.0060.04317.40
5.6.10.0080.03717.28
5.6.00.0100.02317.39
5.5.380.0070.00712.79
5.5.370.0060.03216.59
5.5.360.0120.04216.58
5.5.350.0060.04316.62
5.5.340.0080.03016.87
5.5.330.0080.04316.85
5.5.320.0170.02816.84
5.5.310.0060.02916.83
5.5.300.0050.05016.85
5.5.290.0070.03716.83
5.5.280.0080.04516.84
5.5.270.0040.03416.72
5.5.260.0090.04316.83
5.5.250.0070.03316.75
5.5.240.0080.02016.40
5.5.230.0090.04016.48
5.5.220.0070.04016.50
5.5.210.0080.03516.48
5.5.200.0100.04016.52
5.5.190.0120.03716.52
5.5.180.0120.03816.46
5.5.170.0100.00714.05
5.5.160.0100.03816.51
5.5.150.0090.03816.48
5.5.140.0120.03516.46
5.5.130.0040.02416.54
5.5.120.0070.04216.51
5.5.110.0060.02416.52
5.5.100.0050.03016.48
5.5.90.0050.04416.46
5.5.80.0090.03216.43
5.5.70.0090.03916.46
5.5.60.0040.04116.45
5.5.50.0070.02316.37
5.5.40.0150.01316.43
5.5.30.0050.02216.37
5.5.20.0080.02216.44
5.5.10.0090.03816.38
5.5.00.0100.02316.44
5.4.450.0110.03816.09
5.4.440.0060.02815.95
5.4.430.0090.02316.04
5.4.420.0050.03016.11
5.4.410.0100.04015.95
5.4.400.0100.04115.97
5.4.390.0060.02315.93
5.4.380.0090.03015.89
5.4.370.0080.02315.88
5.4.360.0110.03115.92
5.4.350.0100.03715.89
5.4.340.0150.03815.95
5.4.330.0070.00712.79
5.4.320.0060.02815.92
5.4.310.0050.02515.80
5.4.300.0110.01715.96
5.4.290.0040.02116.01
5.4.280.0030.04315.86
5.4.270.0050.04415.94
5.4.260.0070.03615.79
5.4.250.0070.03715.88
5.4.240.0080.01515.93
5.4.230.0090.03815.92
5.4.220.0060.01815.88
5.4.210.0060.03815.95
5.4.200.0080.01715.92
5.4.190.0050.04215.92
5.4.180.0070.02015.91
5.4.170.0070.04215.92
5.4.160.0110.03715.96
5.4.150.0070.04315.92
5.4.140.0140.02214.46
5.4.130.0110.03114.58
5.4.120.0090.03514.59
5.4.110.0030.03114.50
5.4.100.0070.03914.60
5.4.90.0020.03314.62
5.4.80.0070.02414.55
5.4.70.0070.02814.53
5.4.60.0060.03814.59
5.4.50.0110.03014.56
5.4.40.0050.04314.56
5.4.30.0100.03714.54
5.4.20.0060.03414.60
5.4.10.0110.03514.58
5.4.00.0060.03714.30
5.3.290.0070.04213.73
5.3.280.0090.01513.63
5.3.270.0070.02813.70
5.3.260.0090.03513.68
5.3.250.0060.04013.70
5.3.240.0090.03313.71
5.3.230.0120.03213.68
5.3.220.0090.03813.60
5.3.210.0110.02513.68
5.3.200.0120.03213.61
5.3.190.0040.03713.60
5.3.180.0060.02213.68
5.3.170.0040.03613.68
5.3.160.0020.03013.62
5.3.150.0080.03813.62
5.3.140.0060.02313.67
5.3.130.0040.02613.67
5.3.120.0060.02313.67
5.3.110.0080.02713.68
5.3.100.0060.04013.41
5.3.90.0090.02813.39
5.3.80.0060.03713.39
5.3.70.0060.04213.41
5.3.60.0050.03313.29
5.3.50.0080.03713.31
5.3.40.0090.02113.37
5.3.30.0070.03313.37
5.3.20.0040.02813.13
5.3.10.0040.03613.11
5.3.00.0050.04013.22
5.2.170.0090.03211.90
5.2.160.0070.02711.98
5.2.150.0090.03211.89
5.2.140.0070.03212.01
5.2.130.0030.03311.97
5.2.120.0060.02811.98
5.2.110.0070.02011.85
5.2.100.0080.02811.98
5.2.90.0040.02311.97
5.2.80.0080.03311.95
5.2.70.0100.01811.99
5.2.60.0050.03311.91
5.2.50.0080.03011.89
5.2.40.0070.03211.92
5.2.30.0090.03211.81
5.2.20.0040.03511.81
5.2.10.0070.01711.87
5.2.00.0020.02711.70
5.1.60.0010.03111.43
5.1.50.0070.02711.41
5.1.40.0030.03311.44
5.1.30.0060.02811.60
5.1.20.0050.02911.62
5.1.10.0050.03011.45
5.1.00.0060.02711.44
5.0.50.0050.02010.72
5.0.40.0060.01510.64
5.0.30.0040.03610.53
5.0.20.0040.02510.54
5.0.10.0030.02610.55
5.0.00.0050.03010.54
4.4.90.0040.02010.00
4.4.80.0020.01810.00
4.4.70.0030.01810.00
4.4.60.0040.01810.00
4.4.50.0000.02110.00
4.4.40.0020.02010.00
4.4.30.0020.01610.00
4.4.20.0060.01710.00
4.4.10.0070.01510.00
4.4.00.0030.02410.00
4.3.110.0040.01810.00
4.3.100.0030.01310.00
4.3.90.0030.01710.00
4.3.80.0030.02010.00
4.3.70.0040.01910.00
4.3.60.0050.01310.00
4.3.50.0020.01610.00
4.3.40.0020.02610.00
4.3.30.0020.01910.00
4.3.20.0040.01210.00
4.3.10.0030.01610.00
4.3.00.0030.01610.00

preferences:
41.84 ms | 401 KiB | 5 Q