3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html lang="en"> <head> <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> <script type='text/javascript'> var status =true; var i=2; var j =1; <?php $filename = "basic.srt"; $arr = file($filename); $array = json_encode($arr); echo "var js_arr = ". $array . ";\n"; ?> </script> <meta name="viewport" content="width=700,maximum-scale=1.0,user-scalable=yes"> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div class="wrapper"> <hgroup> <h1><img src="http://a.vimeocdn.com/images_v6/vimeo_logo.png"> Player API Playground</h1> </hgroup> <div class="container"> <div> <h2>Vimeo Player 1</h2> <iframe id="player_1" src="http://player.vimeo.com/video/7100569?api=1&amp;player_id=player_1" width="540" height="304" frameborder="0" webkitallowfullscreen></iframe> <div id="subs" class="inner">replace this</div> <dl class="simple"> <dd><button class="play">Play</button></dd> <dd><button class="pause">Pause</button></dd> <script src="http://a.vimeocdn.com/js/froogaloop2.min.js?d43a8-1394020097"></script> <script> var hour = parseInt(js_arr[j].substring(0,1)); var min = parseInt(js_arr[j].substring(3,4)); var seconds = parseInt(js_arr[j].substring(6,7)); var mil_sec = parseInt(js_arr[j].substring(9,11)); var time = (hour*3600000)+(min*60000)+(seconds*1000)+mil_sec; var bool = false; var a =0; function timeout(status){ setTimeout(function() { if(status) { document.getElementById('subs').innerHTML = js_arr[i]; i=i+4; j=j+4; hour = parseInt(js_arr[j].substring(0,1)); min = parseInt(js_arr[j].substring(3,4)); seconds = parseInt(js_arr[j].substring(6,7)); mil_sec = parseInt(js_arr[j].substring(9,11)); time = (hour*3600000)+(min*60000)+(seconds*1000)+mil_sec; timeout(status); } else{ timeout(status); } },time); } (function(){ // Listen for the ready event for any vimeo video players on the page var vimeoPlayers = document.querySelectorAll('iframe'), player; for (var i = 0, length = vimeoPlayers.length; i < length; i++) { player = vimeoPlayers[i]; $f(player).addEvent('ready', ready); } /** * Utility function for adding an event. Handles the inconsistencies * between the W3C method for adding events (addEventListener) and * IE's (attachEvent). */ function addEvent(element, eventName, callback) { if (element.addEventListener) { element.addEventListener(eventName, callback, false); } else { element.attachEvent('on' + eventName, callback); } } /** * Called once a vimeo player is loaded and ready to receive * commands. You can add events and make api calls only after this * function has been called. */ function ready(player_id) { // Keep a reference to Froogaloop for this player var container = document.getElementById(player_id).parentNode.parentNode, froogaloop = $f(player_id); /** * Sets up the actions for the buttons that will perform simple * api calls to Froogaloop (play, pause, etc.). These api methods * are actions performed on the player that take no parameters and * return no values. */ function setupSimpleButtons() { var buttons = container.querySelector('div dl.simple'), playBtn = buttons.querySelector('.play'), pauseBtn = buttons.querySelector('.pause') // Call play when play button clicked addEvent(playBtn, 'click', function() { froogaloop.api('play'); timeout(status); }, false); // Call pause when pause button clicked addEvent(pauseBtn, 'click', function() { froogaloop.api('pause'); timeout(status=false); }, false); } /** * Sets up the actions for the buttons that will modify certain * things about the player and the video in it. These methods * take a parameter, such as a color value when setting a color. */ /** * Sets up actions for buttons that will ask the player for something, * such as the current time or duration. These methods require a * callback function which will be called with any data as the first * parameter in that function. */ function setupGetterButtons() { var buttons = container.querySelector('div dl.getters'), timeBtn = buttons.querySelector('.time'), pausedBtn = buttons.querySelector('.paused'), widthBtn = buttons.querySelector('.width'), heightBtn = buttons.querySelector('.height'); // Get the current time and log it to the API console when time button clicked addEvent(timeBtn, 'click', function(e) { froogaloop.api('getCurrentTime', function (value, player_id) { // Log out the value in the API Console apiLog('getCurrentTime : ' + value); }); }, false); // Get the paused state and log it to the API console when time button clicked addEvent(pausedBtn, 'click', function(e) { froogaloop.api('paused', function (value, player_id) { // Log out the value in the API Console apiLog('paused : ' + value); }); }, false); // Get the paused state and log it to the API console when time button clicked addEvent(widthBtn, 'click', function(e) { froogaloop.api('getVideoWidth', function (value, player_id) { // Log out the value in the API Console apiLog('getVideoWidth : ' + value); }); }, false); // Get the paused state and log it to the API console when time button clicked addEvent(heightBtn, 'click', function(e) { froogaloop.api('getVideoHeight', function (value, player_id) { // Log out the value in the API Console apiLog('getVideoHeight : ' + value); }); }, false); } /** * Adds listeners for the events that are checked. Adding an event * through Froogaloop requires the event name and the callback method * that is called once the event fires. */ function setupEventListeners() { var checkboxes = container.querySelector('.listeners'), loadProgressChk = checkboxes.querySelector('.loadProgress'), playProgressChk = checkboxes.querySelector('.playProgress'), playChk = checkboxes.querySelector('.play'), pauseChk = checkboxes.querySelector('.pause'), finishChk = checkboxes.querySelector('.finish'); function onLoadProgress() { if (loadProgressChk.checked) { froogaloop.addEvent('loadProgress', function(data) { apiLog('loadProgress event : ' + data.percent + ' : ' + data.bytesLoaded + ' : ' + data.bytesTotal + ' : ' + data.duration); }); } else { froogaloop.removeEvent('loadProgress'); } } function onPlayProgress() { if (playProgressChk.checked) { froogaloop.addEvent('playProgress', function(data) { apiLog('playProgress event : ' + data.seconds + ' : ' + data.percent + ' : ' + data.duration); }); } else { froogaloop.removeEvent('playProgress'); } } function onPlay() { status = true; } function onPause() { status = false; } function onFinish() { if (finishChk.checked) { froogaloop.addEvent('finish', function(data) { apiLog('finish'); }); } else { froogaloop.removeEvent('finish'); } } // Listens for the checkboxes to change addEvent(loadProgressChk, 'change', onLoadProgress, false); addEvent(playProgressChk, 'change', onPlayProgress, false); addEvent(playChk, 'change', onPlay, false); addEvent(pauseChk, 'change', onPause, false); addEvent(finishChk, 'change', onFinish, false); // Calls the change event if the option is checked // (this makes sure the checked events get attached on page load as well as on changed) onLoadProgress(); onPlayProgress(); onPlay(); onPause(); onFinish(); } /** * Sets up actions for adding a new clip window to the page. */ function setupAddClip() { var button = container.querySelector('.addClip'), newContainer; addEvent(button, 'click', function(e) { // Don't do anything if clicking on anything but the button (such as the input field) if (e.target != this) { return false; } // Gets the index of the current player by simply grabbing the number after the underscore var currentIndex = parseInt(player_id.split('_')[1]), clipId = button.querySelector('input').value; newContainer = resetContainer(container.cloneNode(true), currentIndex+1, clipId); container.parentNode.appendChild(newContainer); $f(newContainer.querySelector('iframe')).addEvent('ready', ready); }); /** * Resets the duplicate container's information, clearing out anything * that doesn't pertain to the new clip. It also sets the iframe to * use the new clip's id as its url. */ function resetContainer(element, index, clipId) { var newHeading = element.querySelector('h2'), newIframe = element.querySelector('iframe'), newCheckBoxes = element.querySelectorAll('.listeners input[type="checkbox"]'), newAddBtn = element.querySelector('.addClip'); // Set the heading text newHeading.innerText = 'Vimeo Player ' + index; // Set the correct source of the new clip id newIframe.src = 'http://player.vimeo.com/video/' + clipId + '?api=1&player_id=player_' + index; newIframe.id = 'player_' + index; // Reset all the checkboxes for listeners to be checked on for (var i = 0, length = newCheckBoxes.length, checkbox; i < length; i++) { checkbox = newCheckBoxes[i]; checkbox.setAttribute('checked', 'checked'); } // Clear out the API console newApiConsole.innerHTML = ''; // Update the clip ID of the add clip button return element; } } setupSimpleButtons(); setupModifierButtons(); setupGetterButtons(); setupEventListeners(); setupAddClip(); // Setup clear console button var clearBtn = container.querySelector('.console button'); addEvent(clearBtn, 'click', function(e) { apiConsole.innerHTML = ''; }, false); apiLog(player_id + 'ready!'); } })(); </script> </body> </html>

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)
8.3.60.0000.01518.28
8.3.50.0110.00721.15
8.3.40.0110.00418.85
8.3.30.0040.01419.08
8.3.20.0080.00020.29
8.3.10.0030.00522.09
8.3.00.0080.00022.43
8.2.180.0090.00916.63
8.2.170.0140.00322.96
8.2.160.0110.00322.17
8.2.150.0000.00824.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00419.66
8.2.110.0090.00020.46
8.2.100.0090.00318.03
8.2.90.0100.00019.21
8.2.80.0080.00017.97
8.2.70.0030.00617.50
8.2.60.0060.00318.05
8.2.50.0040.00418.10
8.2.40.0030.00618.16
8.2.30.0040.00417.98
8.2.20.0000.00717.81
8.2.10.0030.00517.77
8.2.00.0040.00417.77
8.1.280.0060.01325.92
8.1.270.0040.00418.65
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0090.00023.84
8.1.230.0080.00320.30
8.1.220.0040.00417.74
8.1.210.0050.00518.77
8.1.200.0100.00017.35
8.1.190.0090.00017.22
8.1.180.0000.00818.10
8.1.170.0040.00418.48
8.1.160.0070.00022.10
8.1.150.0040.00418.67
8.1.140.0040.00417.48
8.1.130.0000.00717.90
8.1.120.0030.00517.51
8.1.110.0040.00417.51
8.1.100.0050.00217.54
8.1.90.0070.00317.47
8.1.80.0040.00417.43
8.1.70.0030.00317.55
8.1.60.0040.00417.52
8.1.50.0040.00417.57
8.1.40.0040.00417.54
8.1.30.0000.00817.57
8.1.20.0030.00517.70
8.1.10.0000.00817.53
8.1.00.0070.00017.53
8.0.300.0050.00318.77
8.0.290.0060.00316.88
8.0.280.0030.00318.48
8.0.270.0070.00017.23
8.0.260.0000.00716.86
8.0.250.0000.00717.11
8.0.240.0040.00416.94
8.0.230.0030.00316.97
8.0.220.0030.00316.93
8.0.210.0000.00716.91
8.0.200.0000.00617.08
8.0.190.0050.00316.96
8.0.180.0070.00017.04
8.0.170.0040.00417.09
8.0.160.0080.00016.84
8.0.150.0050.00216.84
8.0.140.0040.00416.80
8.0.130.0060.00013.48
8.0.120.0040.00416.98
8.0.110.0070.00017.00
8.0.100.0050.00316.91
8.0.90.0040.00416.83
8.0.80.0030.01316.95
8.0.70.0040.00416.86
8.0.60.0040.00416.80
8.0.50.0040.00416.82
8.0.30.0130.00817.02
8.0.20.0090.01017.40
8.0.10.0030.00517.12
8.0.00.0100.01016.83
7.4.330.0000.00415.00
7.4.320.0030.00316.48
7.4.300.0000.00716.46
7.4.290.0070.00016.50
7.4.280.0030.00316.45
7.4.270.0070.00016.57
7.4.260.0000.00716.59
7.4.250.0040.00416.46
7.4.240.0070.00016.49
7.4.230.0000.00716.59
7.4.220.0120.00616.44
7.4.210.0090.00716.60
7.4.200.0000.00716.66
7.4.190.0000.00816.54
7.4.160.0110.00516.42
7.4.150.0070.01017.40
7.4.140.0110.00917.86
7.4.130.0070.01016.54
7.4.120.0090.01216.49
7.4.110.0090.01016.78
7.4.100.0000.01916.50
7.4.90.0180.00616.47
7.4.80.0070.01019.39
7.4.70.0150.00316.44
7.4.60.0110.00616.53
7.4.50.0060.00316.40
7.4.40.0030.01022.77
7.4.30.0070.01016.38
7.4.00.0090.00914.72
7.3.330.0000.00513.22
7.3.320.0050.00013.08
7.3.310.0000.00616.42
7.3.300.0040.00216.38
7.3.290.0100.01016.30
7.3.280.0070.00816.39
7.3.270.0170.00017.40
7.3.260.0130.00316.61
7.3.250.0080.01016.64
7.3.240.0090.00916.55
7.3.230.0100.01316.39
7.3.210.0110.00616.51
7.3.200.0130.01019.39
7.3.190.0160.00316.39
7.3.180.0120.00416.31
7.3.170.0100.00716.41
7.3.160.0060.00916.54
7.3.120.0040.01115.04
7.2.330.0070.01016.37
7.2.320.0080.00816.61
7.2.310.0050.01216.79
7.2.300.0030.01516.53
7.2.290.0070.01016.64
7.2.00.0030.01419.34
7.1.100.0130.00317.97
7.1.70.0030.00716.85
7.1.60.0140.01119.82
7.1.50.0070.01616.93
7.1.00.0030.03322.46
7.0.200.0030.00316.60
7.0.140.0130.06722.05
7.0.90.0100.08319.91
7.0.80.0030.06020.00
7.0.70.0570.08020.02
7.0.60.0600.03719.79
7.0.50.0530.08020.26
7.0.40.0070.08320.08
7.0.30.0000.09320.00
7.0.20.0000.06020.07
7.0.10.0070.08720.12
7.0.00.0000.09020.12
5.6.280.0070.07021.12
5.6.240.0100.07320.54
5.6.230.0070.08320.70
5.6.220.0170.04720.56
5.6.210.0030.07720.73
5.6.200.0100.05321.14
5.6.190.0100.06021.13
5.6.180.0130.07321.07
5.6.170.0070.07721.13
5.6.160.0000.09321.10
5.6.150.0100.07320.98
5.6.140.0070.04320.98
5.6.130.0030.08721.07
5.6.120.0030.05021.19
5.6.110.0130.07021.11
5.6.100.0130.07720.95
5.6.90.0230.06320.96
5.6.80.0030.07320.46
5.6.70.0000.08020.58
5.6.60.0130.07320.43
5.6.50.0100.07720.49
5.6.40.0170.06320.55
5.6.30.0170.06720.33
5.6.20.0200.06320.39
5.6.10.0070.04320.45
5.6.00.0100.04020.53
5.5.380.0100.08720.38
5.5.370.0130.06720.34
5.5.360.0030.05020.40
5.5.350.0100.07320.45
5.5.340.0100.07720.91
5.5.330.0130.06320.93
5.5.320.0130.07320.83
5.5.310.0000.09020.85
5.5.300.0070.07320.82
5.5.290.0170.07320.79
5.5.280.0030.07320.78
5.5.270.0100.08320.81
5.5.260.0100.08020.94
5.5.250.0030.08720.72
5.5.240.0100.06020.28
5.5.230.0070.08020.32
5.5.220.0070.07020.16
5.5.210.0030.06320.26
5.5.200.0030.08720.30
5.5.190.0130.06320.16
5.5.180.0070.07720.29
5.5.160.0030.08720.27
5.5.150.0130.06320.20
5.5.140.0100.05320.20
5.5.130.0170.07320.20
5.5.120.0100.05020.26
5.5.110.0070.04320.10
5.5.100.0070.08020.00
5.5.90.0100.07720.13
5.5.80.0030.07720.11
5.5.70.0130.07320.17
5.5.60.0000.07320.08
5.5.50.0100.07320.07
5.5.40.0030.07320.09
5.5.30.0070.07720.06
5.5.20.0070.08020.10
5.5.10.0030.05020.09
5.5.00.0070.05720.13
5.4.450.0070.08319.45
5.4.440.0030.08719.37
5.4.430.0100.06319.41
5.4.420.0070.08019.55
5.4.410.0030.07719.32
5.4.400.0170.06719.15
5.4.390.0070.07719.02
5.4.380.0030.05718.79
5.4.370.0130.06718.90
5.4.360.0070.07718.90
5.4.350.0170.05319.07
5.4.340.0130.06318.81
5.4.320.0130.06719.14
5.4.310.0070.07719.23
5.4.300.0030.06719.03
5.4.290.0200.06718.98
5.4.280.0030.06019.11
5.4.270.0170.06719.11
5.4.260.0030.08019.07
5.4.250.0170.07318.99
5.4.240.0130.05719.04
5.4.230.0100.04318.96
5.4.220.0070.08319.09
5.4.210.0030.05318.93
5.4.200.0130.06319.11
5.4.190.0100.07019.10
5.4.180.0100.07018.97
5.4.170.0130.07018.80
5.4.160.0130.07019.02
5.4.150.0130.07319.07
5.4.140.0030.07716.23
5.4.130.0070.06316.25
5.4.120.0100.07016.25
5.4.110.0070.07016.45
5.4.100.0100.06716.36
5.4.90.0030.07016.25
5.4.80.0070.06016.21
5.4.70.0070.03716.23
5.4.60.0000.03716.19
5.4.50.0070.02716.21
5.4.40.0070.03316.24
5.4.30.0030.03716.21
5.4.20.0030.04316.18
5.4.10.0000.03316.21
5.4.00.0000.04315.52
5.3.290.0070.08014.59
5.3.280.0100.07014.46
5.3.270.0100.07314.44
5.3.260.0170.07014.60
5.3.250.0070.07314.59
5.3.240.0130.07014.43
5.3.230.0030.07314.46
5.3.220.0100.07014.48
5.3.210.0070.07714.40
5.3.200.0100.07314.57
5.3.190.0170.05714.57
5.3.180.0070.06714.56
5.3.170.0030.03714.39
5.3.160.0130.03714.58
5.3.150.0030.03714.44
5.3.140.0030.06314.56
5.3.130.0030.03314.52
5.3.120.0030.03314.49
5.3.110.0000.04014.50
5.3.100.0030.06713.91
5.3.90.0070.03314.01
5.3.80.0000.04013.89
5.3.70.0070.02713.89
5.3.60.0130.04313.96
5.3.50.0030.04013.95
5.3.40.0000.04013.92
5.3.30.0030.03313.85
5.3.20.0000.03713.65
5.3.10.0070.03013.52
5.3.00.0000.06013.64

preferences:
44.55 ms | 401 KiB | 5 Q