3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://tvprofil.net/xmltv/data/cnn.info/weekly_cnn.info_tvprofil.net.xml'; $xml = simplexml_load_file($url); $startTimeUnix = time() - 7200; $i = 0; foreach($xml->programme as $programm) { $start = DateTime::createFromFormat('YmdHis', $programm->attributes()->start)->getTimestamp(); if ($start > $startTimeUnix) break; $i++; } echo '<b>Now:</b> ' , $xml->programme[$i]->title , '<br/>'; echo '<b>Next:</b> ', $xml->programme[++$i]->title;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 28
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 28
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 26
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 28
Branch analysis from position: 28
filename:       /in/CGebh
function name:  (null)
number of ops:  42
compiled vars:  !0 = $url, !1 = $xml, !2 = $startTimeUnix, !3 = $i, !4 = $programm, !5 = $start
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Ftvprofil.net%2Fxmltv%2Fdata%2Fcnn.info%2Fweekly_cnn.info_tvprofil.net.xml'
    3     1        INIT_FCALL                                               'simplexml_load_file'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !1, $7
    7     5        INIT_FCALL                                               'time'
          6        DO_ICALL                                         $9      
          7        SUB                                              ~10     $9, 7200
          8        ASSIGN                                                   !2, ~10
    8     9        ASSIGN                                                   !3, 0
    9    10        FETCH_OBJ_R                                      ~13     !1, 'programme'
         11      > FE_RESET_R                                       $14     ~13, ->28
         12    > > FE_FETCH_R                                               $14, !4, ->28
   11    13    >   INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         14        SEND_VAL                                                 'YmdHis'
         15        INIT_METHOD_CALL                                         !4, 'attributes'
         16        DO_FCALL                                      0  $15     
         17        FETCH_OBJ_R                                      ~16     $15, 'start'
         18        SEND_VAL                                                 ~16
         19        DO_FCALL                                      0  $17     
         20        INIT_METHOD_CALL                                         $17, 'getTimestamp'
         21        DO_FCALL                                      0  $18     
         22        ASSIGN                                                   !5, $18
   12    23        IS_SMALLER                                               !2, !5
         24      > JMPZ                                                     ~20, ->26
   13    25    > > JMP                                                      ->28
   14    26    >   PRE_INC                                                  !3
    9    27      > JMP                                                      ->12
         28    >   FE_FREE                                                  $14
   17    29        ECHO                                                     '%3Cb%3ENow%3A%3C%2Fb%3E+'
         30        FETCH_OBJ_R                                      ~22     !1, 'programme'
         31        FETCH_DIM_R                                      ~23     ~22, !3
         32        FETCH_OBJ_R                                      ~24     ~23, 'title'
         33        ECHO                                                     ~24
         34        ECHO                                                     '%3Cbr%2F%3E'
   18    35        ECHO                                                     '%3Cb%3ENext%3A%3C%2Fb%3E+'
         36        PRE_INC                                          ~26     !3
         37        FETCH_OBJ_R                                      ~25     !1, 'programme'
         38        FETCH_DIM_R                                      ~27     ~25, ~26
         39        FETCH_OBJ_R                                      ~28     ~27, 'title'
         40        ECHO                                                     ~28
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.2 ms | 1400 KiB | 17 Q