3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array(Array ( [itag] => 22 [url] => http://r2---sn-5hn7ym76.googlevideo.com/videoplayback?expire=1412296888&id=o-AIGbtbxkRlIUJijLHwpauF-HOwczoehlC5IM4rY-UIto&ratebypass=yes&upn=1SSnanIS0QY&signature=4CD2CB7FBF5DF6022F5895AE1B91453672B98ECF.C8E1A926E383F81D6FE1910BC8505030AD88E4D6&mm=31&fexp=908204%2C927622%2C930666%2C931983%2C932404%2C934030%2C938652%2C946020%2C947209%2C952302%2C953801&ipbits=0&sparams=id%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cnh%2Cratebypass%2Csource%2Cupn%2Cexpire&itag=22&mt=1412275240&mime=video%2Fmp4&sver=3&ip=31.220.17.48&key=yt5&ms=au&nh=EAE&mv=u&source=youtube [type] => video/mp4; codecs="avc1.64001F, mp4a.40.2" [quality] => hd720 [fallback_host] => tc.v17.cache6.googlevideo.com ) Array ( [itag] => 43 [url] => http://r2---sn-5hn7ym76.googlevideo.com/videoplayback?expire=1412296888&id=o-AIGbtbxkRlIUJijLHwpauF-HOwczoehlC5IM4rY-UIto&ratebypass=yes&upn=1SSnanIS0QY&signature=59DDC6C0C9455E1CA2F92888EF37FA59FC559C70.5817267E19AE5C4633C41905CB3544B74DE10DBB&mm=31&fexp=908204%2C927622%2C930666%2C931983%2C932404%2C934030%2C938652%2C946020%2C947209%2C952302%2C953801&ipbits=0&sparams=id%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cnh%2Cratebypass%2Csource%2Cupn%2Cexpire&itag=43&mt=1412275240&mime=video%2Fwebm&sver=3&ip=31.220.17.48&key=yt5&ms=au&nh=EAE&mv=u&source=youtube [type] => video/webm; codecs="vp8.0, vorbis" [quality] => medium [fallback_host] => tc.v23.cache2.googlevideo.com ) Array ( [itag] => 18 [url] => http://r2---sn-5hn7ym76.googlevideo.com/videoplayback?expire=1412296888&id=o-AIGbtbxkRlIUJijLHwpauF-HOwczoehlC5IM4rY-UIto&ratebypass=yes&upn=1SSnanIS0QY&signature=12AA8E6A4BAFA07F3BC214D11227A37DF0DCAE3A.43825EC53793A7A78811AC796D223FABEE7454A0&mm=31&fexp=908204%2C927622%2C930666%2C931983%2C932404%2C934030%2C938652%2C946020%2C947209%2C952302%2C953801&ipbits=0&sparams=id%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cnh%2Cratebypass%2Csource%2Cupn%2Cexpire&itag=18&mt=1412275240&mime=video%2Fmp4&sver=3&ip=31.220.17.48&key=yt5&ms=au&nh=EAE&mv=u&source=youtube [type] => video/mp4; codecs="avc1.42001E, mp4a.40.2" [quality] => medium [fallback_host] => tc.v21.cache4.googlevideo.com ) Array ( [itag] => 5 [url] => http://r2---sn-5hn7ym76.googlevideo.com/videoplayback?expire=1412296888&id=o-AIGbtbxkRlIUJijLHwpauF-HOwczoehlC5IM4rY-UIto&mime=video%2Fx-flv&upn=1SSnanIS0QY&signature=57EA4B4031C055431FB9502F772D70E262D93013.9CA255EB600D30AFF22DCDCE5D880CDD6BCD08EB&mm=31&fexp=908204%2C927622%2C930666%2C931983%2C932404%2C934030%2C938652%2C946020%2C947209%2C952302%2C953801&ipbits=0&sparams=id%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cnh%2Csource%2Cupn%2Cexpire&itag=5&mt=1412275240&sver=3&ip=31.220.17.48&key=yt5&ms=au&nh=EAE&mv=u&source=youtube [type] => video/x-flv [quality] => small [fallback_host] => tc.v21.cache5.googlevideo.com ) Array ( [itag] => 36 [url] => http://r2---sn-5hn7ym76.googlevideo.com/videoplayback?expire=1412296888&id=o-AIGbtbxkRlIUJijLHwpauF-HOwczoehlC5IM4rY-UIto&mime=video%2F3gpp&upn=1SSnanIS0QY&signature=0167D28A4E9523AB0CE13FFD1535E285A0896E23.0B3B5B0934A25AC4D79001022B4F7706CE226A11&mm=31&fexp=908204%2C927622%2C930666%2C931983%2C932404%2C934030%2C938652%2C946020%2C947209%2C952302%2C953801&ipbits=0&sparams=id%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cnh%2Csource%2Cupn%2Cexpire&itag=36&mt=1412275240&sver=3&ip=31.220.17.48&key=yt5&ms=au&nh=EAE&mv=u&source=youtube [type] => video/3gpp; codecs="mp4v.20.3, mp4a.40.2" [quality] => small [fallback_host] => tc.v15.cache4.googlevideo.com ) Array ( [itag] => 17 [url] => http://r2---sn-5hn7ym76.googlevideo.com/videoplayback?expire=1412296888&id=o-AIGbtbxkRlIUJijLHwpauF-HOwczoehlC5IM4rY-UIto&mime=video%2F3gpp&upn=1SSnanIS0QY&signature=35DB723F850B2EAB2CFB9AE879394A58298934A4.2978D7139C8B26D1D0D4134E198C696449EEB850&mm=31&fexp=908204%2C927622%2C930666%2C931983%2C932404%2C934030%2C938652%2C946020%2C947209%2C952302%2C953801&ipbits=0&sparams=id%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cnh%2Csource%2Cupn%2Cexpire&itag=17&mt=1412275240&sver=3&ip=31.220.17.48&key=yt5&ms=au&nh=EAE&mv=u&source=youtube [type] => video/3gpp; codecs="mp4v.20.3, mp4a.40.2" [quality] => small [fallback_host] => tc.v18.cache8.googlevideo.com )) ); $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);
based on MrrV0
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.4.32
Parse error: syntax error, unexpected '[', expecting ')' in /in/NRmPX 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/NRmPX on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/NRmPX on line 3
Process exited with code 255.