3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = Array ( [0] => Array ( [url] => http://r2---sn-5hn7ym76.googlevideo.com/videoplayback?sparams=id%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cnh%2Cratebypass%2Csource%2Cupn%2Cexpire&mt=1412346571&signature=2631BE84B740AC5CB765A1DE542F16352DE89C63.A1A677E02CD3EE3041CA39D48FE71A3596E934DD&id=o-AHHVhMFadxGHI7abCtZ9ZHsCJJSIX8X9nMdvePJzDoet&upn=qDOpJoZxbTY&sver=3&mm=31&fexp=908208%2C910207%2C927622%2C930666%2C931983%2C932404%2C934030%2C938676%2C946023%2C947209%2C952302%2C953801&ms=au&nh=EAE&mv=u&ip=31.220.17.48&ipbits=0&ratebypass=yes&expire=1412368200&itag=22&key=yt5&source=youtube&mime=video%2Fmp4 [quality] => hd720 [itag] => 22 [fallback_host] => tc.v17.cache6.googlevideo.com [type] => video/mp4; codecs="avc1.64001F, mp4a.40.2" ) ) Array ( [0] => Array ( [url] => http://r2---sn-5hn7ym76.googlevideo.com/videoplayback?sparams=id%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cnh%2Cratebypass%2Csource%2Cupn%2Cexpire&mt=1412346571&signature=31ECE73573F4285F9E897C6E844A1CFD1EA6A908.53E6C1FF2B004F503D9F92B9EF0E3B64674997D3&id=o-AHHVhMFadxGHI7abCtZ9ZHsCJJSIX8X9nMdvePJzDoet&upn=qDOpJoZxbTY&sver=3&mm=31&fexp=908208%2C910207%2C927622%2C930666%2C931983%2C932404%2C934030%2C938676%2C946023%2C947209%2C952302%2C953801&ms=au&nh=EAE&mv=u&ip=31.220.17.48&ipbits=0&ratebypass=yes&expire=1412368200&itag=43&key=yt5&source=youtube&mime=video%2Fwebm [quality] => medium [itag] => 43 [fallback_host] => tc.v23.cache2.googlevideo.com [type] => video/webm; codecs="vp8.0, vorbis" ) ) Array ( [0] => Array ( [url] => http://r2---sn-5hn7ym76.googlevideo.com/videoplayback?sparams=id%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cnh%2Cratebypass%2Csource%2Cupn%2Cexpire&mt=1412346571&signature=F2AF42839FCB2AB00AA54C2E89EB2E933572AF4E.650DD561DC8A9E0E1F7D531C54B420E97C02C9A6&id=o-AHHVhMFadxGHI7abCtZ9ZHsCJJSIX8X9nMdvePJzDoet&upn=qDOpJoZxbTY&sver=3&mm=31&fexp=908208%2C910207%2C927622%2C930666%2C931983%2C932404%2C934030%2C938676%2C946023%2C947209%2C952302%2C953801&ms=au&nh=EAE&mv=u&ip=31.220.17.48&ipbits=0&ratebypass=yes&expire=1412368200&itag=18&key=yt5&source=youtube&mime=video%2Fmp4 [quality] => medium [itag] => 18 [fallback_host] => tc.v21.cache4.googlevideo.com [type] => video/mp4; codecs="avc1.42001E, mp4a.40.2" ) ) Array ( [0] => Array ( [url] => http://r2---sn-5hn7ym76.googlevideo.com/videoplayback?sparams=id%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cnh%2Csource%2Cupn%2Cexpire&mt=1412346571&signature=C8CA67583F7F68CD1312DF1A351765D5AF5B026F.3A70165E59B6F8AA30BEEFD9091D22343C0754C5&id=o-AHHVhMFadxGHI7abCtZ9ZHsCJJSIX8X9nMdvePJzDoet&sver=3&mm=31&fexp=908208%2C910207%2C927622%2C930666%2C931983%2C932404%2C934030%2C938676%2C946023%2C947209%2C952302%2C953801&ms=au&nh=EAE&mv=u&ip=31.220.17.48&ipbits=0&upn=qDOpJoZxbTY&expire=1412368200&itag=5&key=yt5&source=youtube&mime=video%2Fx-flv [quality] => small [itag] => 5 [fallback_host] => tc.v21.cache5.googlevideo.com [type] => video/x-flv ) ) Array ( [0] => Array ( [url] => http://r2---sn-5hn7ym76.googlevideo.com/videoplayback?sparams=id%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cnh%2Csource%2Cupn%2Cexpire&mt=1412346571&signature=CAE6F4B494BE321FDF9E5E193FF5D7E056F7AA21.C9E02D434A9E7D588103650836BCE917CA2C7C56&id=o-AHHVhMFadxGHI7abCtZ9ZHsCJJSIX8X9nMdvePJzDoet&sver=3&mm=31&fexp=908208%2C910207%2C927622%2C930666%2C931983%2C932404%2C934030%2C938676%2C946023%2C947209%2C952302%2C953801&ms=au&nh=EAE&mv=u&ip=31.220.17.48&ipbits=0&upn=qDOpJoZxbTY&expire=1412368200&itag=36&key=yt5&source=youtube&mime=video%2F3gpp [quality] => small [itag] => 36 [fallback_host] => tc.v15.cache4.googlevideo.com [type] => video/3gpp; codecs="mp4v.20.3, mp4a.40.2" ) ) Array ( [0] => Array ( [url] => http://r2---sn-5hn7ym76.googlevideo.com/videoplayback?sparams=id%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cnh%2Csource%2Cupn%2Cexpire&mt=1412346571&signature=D87738990A0266014EC8734196FE7E960BFC7F94.D40B5DD55A2F5D6FEEBD3DBA95776A580BFA2FB2&id=o-AHHVhMFadxGHI7abCtZ9ZHsCJJSIX8X9nMdvePJzDoet&sver=3&mm=31&fexp=908208%2C910207%2C927622%2C930666%2C931983%2C932404%2C934030%2C938676%2C946023%2C947209%2C952302%2C953801&ms=au&nh=EAE&mv=u&ip=31.220.17.48&ipbits=0&upn=qDOpJoZxbTY&expire=1412368200&itag=17&key=yt5&source=youtube&mime=video%2F3gpp [quality] => small [itag] => 17 [fallback_host] => tc.v18.cache8.googlevideo.com [type] => video/3gpp; codecs="mp4v.20.3, mp4a.40.2" ) ); print_r ($array); $r = array(); function test($array, $number) { foreach($array as $r) if ($r['itag'] == $number) { echo '<a href="'.$r['url'].'">quality: '.$r['itag'].'</a>'; } } test($array, 43); test($array, 18); test($array, 36);
based on RAR0m
Output for 5.4.0 - 5.4.32
Parse error: syntax error, unexpected ':', expecting ')' in /in/X6uJt on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/X6uJt on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[', expecting ')' in /in/X6uJt on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/X6uJt on line 3
Process exited with code 255.