3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html> <head> <title>TOP SECRET</title> <style> pre { font-size: 10pt; font-family: "Fira Code"; font-weight: bold; } </style> </head> <body> <?php $counter = 0; # https://gist.github.com/NuckChorris/fd73d6744e56545c8def # $url = "https://gist.github.com/NuckChorris/fd73d6744e56545c8def/raw/674266cc5edf294e70b39e75298dbb52911b7332/2014_season_stats.json"; $url = "https://gist.github.com/NuckChorris/fd73d6744e56545c8def/raw/7bad79aead47eddeba5667a422c7f5c00f31fc3a/2014_type_stats.json"; # Turns URL into JSON $json = file_get_contents($url); # Turns JSON into PHP array() $data = json_decode($json, true); # Target data needed $data = $data['TV']; # Create an empty array() for the foreach loop $sort = array(); # Loop through the array foreach ($data as $key => $row) { # Use for Most Popular $sort[$key] = $row['count']; # Use for Highest Rated #if($row['count'] > 0){ # $sort[$key] = $row['rating']; #} else { # $sort[$key] = 0; #} } # Sort the array by 'count' or 'rating' as defined above array_multisort($sort, SORT_DESC , $data); # Print array into webpage from highest to lowest count foreach ($data as $key => $row) { $counter++; print "<pre>" . $counter . ")<br>" . # Use $key for Genres and Seasons, # Use $row['slug'] for Type. #$key . $row['slug'] . "<br>View: " . $row['count'] . "<br>Rati: " . round($row['rating'], 2) . "<br>" . "<br>Comp: " . $row['distribution']['Completed'] . "<br>Curr: " . $row['distribution']['Currently Watching'] . "<br>Drop: " . $row['distribution']['Dropped'] . "<br>On H: " . $row['distribution']['On Hold'] . "<br>Plan: " . $row['distribution']['Plan to Watch'] . "<br><br></pre>"; } ?> </body> </html>
Output for git.master, git.master_jit
<!DOCTYPE html> <html> <head> <title>TOP SECRET</title> <style> pre { font-size: 10pt; font-family: "Fira Code"; font-weight: bold; } </style> </head> <body> Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/vpdvc on line 27 Warning: file_get_contents(): open_basedir restriction in effect. File(https://gist.github.com/NuckChorris/fd73d6744e56545c8def/raw/7bad79aead47eddeba5667a422c7f5c00f31fc3a/2014_type_stats.json) is not within the allowed path(s): (/tmp:/in:/etc) in /in/vpdvc on line 27 Warning: file_get_contents(https://gist.github.com/NuckChorris/fd73d6744e56545c8def/raw/7bad79aead47eddeba5667a422c7f5c00f31fc3a/2014_type_stats.json): Failed to open stream: Operation not permitted in /in/vpdvc on line 27 Warning: Trying to access array offset on value of type null in /in/vpdvc on line 33 Warning: foreach() argument must be of type array|object, null given in /in/vpdvc on line 39 Fatal error: Uncaught TypeError: array_multisort(): Argument #3 must be an array or a sort flag in /in/vpdvc:53 Stack trace: #0 /in/vpdvc(53): array_multisort(Array, 3, NULL) #1 {main} thrown in /in/vpdvc on line 53
Process exited with code 255.
Output for rfc.property-hooks
<!DOCTYPE html> <html> <head> <title>TOP SECRET</title> <style> pre { font-size: 10pt; font-family: "Fira Code"; font-weight: bold; } </style> </head> <body> Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/vpdvc on line 27 Warning: file_get_contents(): open_basedir restriction in effect. File(https://gist.github.com/NuckChorris/fd73d6744e56545c8def/raw/7bad79aead47eddeba5667a422c7f5c00f31fc3a/2014_type_stats.json) is not within the allowed path(s): (/tmp:/in:/etc) in /in/vpdvc on line 27 Warning: file_get_contents(https://gist.github.com/NuckChorris/fd73d6744e56545c8def/raw/7bad79aead47eddeba5667a422c7f5c00f31fc3a/2014_type_stats.json): Failed to open stream: Operation not permitted in /in/vpdvc on line 27 Warning: Trying to access array offset on null in /in/vpdvc on line 33 Warning: foreach() argument must be of type array|object, null given in /in/vpdvc on line 39 Fatal error: Uncaught TypeError: array_multisort(): Argument #3 must be an array or a sort flag in /in/vpdvc:53 Stack trace: #0 /in/vpdvc(53): array_multisort(Array, 3, NULL) #1 {main} thrown in /in/vpdvc on line 53
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
52.31 ms | 402 KiB | 8 Q