3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php header('Content-Type: application/json'); $rows = 10; $tp_chan=436; $tp_profi=116; $tp_sec_start=1; $ts_sec_start=2; $server = 'http://ott.cdn.iutpcdn.com/LIVE/H01/CANAL'.$tp_chan.'/PROFILE03-'.$tp_profi.'/'; $count = 0; $nextsecPlus = 4; $ignoreFive=false; $ignoreFive2=false; //$today = date('Ymd'); $today = mktime(0, 0, 0, date("m") , date("d")-1, date("Y")); echo "#EXTM3U #EXT-X-VERSION:3 #EXT-X-TARGETDURATION:5 #EXT-X-MEDIA-SEQUENCE:".$tp_profi."0".$tp_sec_start."\n"; for($i = 0; $i < $rows; $i++) { if($nextsecPlus==4){ if($ignoreFive==true && $ignoreFive2==false){$nextsecPlus = $nextsecPlus;} $ts_sec_start = $ts_sec_start+$nextsecPlus; $ts = /*$nextsecPlus.'A_'.*/$server.$tp_sec_start.'-'.$today.'T'.$ts_sec_start.'.ts?'; if($nextsecPlus==5) { $nextsecPlus=4; $ignoreFive2=true; } } else if($nextsecPlus == 5 && $ignoreFive==false){ $ts_sec_start = $ts_sec_start+5; $ts = /*$nextsecPlus.'B_'.*/$server.$tp_sec_start.'-'.$today.'T'.$ts_sec_start.'.ts?'; $nextsecPlus=3; } else if($nextsecPlus == 3){ $ts_sec_start = $ts_sec_start+$nextsecPlus; $ts = /*$nextsecPlus.'C_'.*/$server.$tp_sec_start.'-'.$today.'T'.$ts_sec_start.'.ts?'; $nextsecPlus=4; $ignoreFive = true; } $count++; if($count >= 5 && $ignoreFive==false && $nextsecPlus ==4){ $nextsecPlus = 5; } $tp_sec_start++; echo "#EXTINF:4.004,\n".$ts."?\n"; } ?>
based on YZYMG
Output for 5.6.38 - 7.3.0rc3
#EXTM3U #EXT-X-VERSION:3 #EXT-X-TARGETDURATION:5 #EXT-X-MEDIA-SEQUENCE:11601 #EXTINF:4.004, http://ott.cdn.iutpcdn.com/LIVE/H01/CANAL436/PROFILE03-116/1-1540767600T6.ts?? #EXTINF:4.004, http://ott.cdn.iutpcdn.com/LIVE/H01/CANAL436/PROFILE03-116/2-1540767600T10.ts?? #EXTINF:4.004, http://ott.cdn.iutpcdn.com/LIVE/H01/CANAL436/PROFILE03-116/3-1540767600T14.ts?? #EXTINF:4.004, http://ott.cdn.iutpcdn.com/LIVE/H01/CANAL436/PROFILE03-116/4-1540767600T18.ts?? #EXTINF:4.004, http://ott.cdn.iutpcdn.com/LIVE/H01/CANAL436/PROFILE03-116/5-1540767600T22.ts?? #EXTINF:4.004, http://ott.cdn.iutpcdn.com/LIVE/H01/CANAL436/PROFILE03-116/6-1540767600T27.ts?? #EXTINF:4.004, http://ott.cdn.iutpcdn.com/LIVE/H01/CANAL436/PROFILE03-116/7-1540767600T30.ts?? #EXTINF:4.004, http://ott.cdn.iutpcdn.com/LIVE/H01/CANAL436/PROFILE03-116/8-1540767600T34.ts?? #EXTINF:4.004, http://ott.cdn.iutpcdn.com/LIVE/H01/CANAL436/PROFILE03-116/9-1540767600T38.ts?? #EXTINF:4.004, http://ott.cdn.iutpcdn.com/LIVE/H01/CANAL436/PROFILE03-116/10-1540767600T42.ts??