3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rss = new DOMDocument(); $rss->load('http://static.cricinfo.com/rss/livescores.xml'); $list = array(); $found = 0; foreach ($rss->getElementsByTagName('item') as $node) { $item = array( 'title' => $node->getElementsByTagName('title')->item(0)->nodeValue, 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue ); array_push($list, $item); } $numberofresults = 20; for ($i = 0; $i < $numberofresults; $i++) { $title = $list[$i]['title']; $titletolower = strtolower($title); $desc = $list[$i]['desc']; $desctolower = strtolower($desc); if (strpos($desctolower, "*") !== false) { $desc = 'Live'; } else { $desc = ' Not Live'; } echo $title . "\n"; echo $desc . "\n"; $found++; } if ($found == 0) { echo $list[$i]['title'][0]; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 35
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 35
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 39
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 76
Branch analysis from position: 72
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 76
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 61
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 39
Branch analysis from position: 70
Branch analysis from position: 39
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 39
Branch analysis from position: 70
Branch analysis from position: 39
Branch analysis from position: 35
filename:       /in/9XS2S
function name:  (null)
number of ops:  77
compiled vars:  !0 = $rss, !1 = $list, !2 = $found, !3 = $node, !4 = $item, !5 = $numberofresults, !6 = $i, !7 = $title, !8 = $titletolower, !9 = $desc, !10 = $desctolower
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $11     'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $11
    3     3        INIT_METHOD_CALL                                         !0, 'load'
          4        SEND_VAL_EX                                              'http%3A%2F%2Fstatic.cricinfo.com%2Frss%2Flivescores.xml'
          5        DO_FCALL                                      0          
    4     6        ASSIGN                                                   !1, <array>
    5     7        ASSIGN                                                   !2, 0
    7     8        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
          9        SEND_VAL_EX                                              'item'
         10        DO_FCALL                                      0  $17     
         11      > FE_RESET_R                                       $18     $17, ->35
         12    > > FE_FETCH_R                                               $18, !3, ->35
    9    13    >   INIT_METHOD_CALL                                         !3, 'getElementsByTagName'
         14        SEND_VAL_EX                                              'title'
         15        DO_FCALL                                      0  $19     
         16        INIT_METHOD_CALL                                         $19, 'item'
         17        SEND_VAL_EX                                              0
         18        DO_FCALL                                      0  $20     
         19        FETCH_OBJ_R                                      ~21     $20, 'nodeValue'
         20        INIT_ARRAY                                       ~22     ~21, 'title'
   10    21        INIT_METHOD_CALL                                         !3, 'getElementsByTagName'
         22        SEND_VAL_EX                                              'description'
         23        DO_FCALL                                      0  $23     
         24        INIT_METHOD_CALL                                         $23, 'item'
         25        SEND_VAL_EX                                              0
         26        DO_FCALL                                      0  $24     
         27        FETCH_OBJ_R                                      ~25     $24, 'nodeValue'
         28        ADD_ARRAY_ELEMENT                                ~22     ~25, 'desc'
    8    29        ASSIGN                                                   !4, ~22
   12    30        INIT_FCALL                                               'array_push'
         31        SEND_REF                                                 !1
         32        SEND_VAR                                                 !4
         33        DO_ICALL                                                 
    7    34      > JMP                                                      ->12
         35    >   FE_FREE                                                  $18
   15    36        ASSIGN                                                   !5, 20
   17    37        ASSIGN                                                   !6, 0
         38      > JMP                                                      ->68
   18    39    >   FETCH_DIM_R                                      ~30     !1, !6
         40        FETCH_DIM_R                                      ~31     ~30, 'title'
         41        ASSIGN                                                   !7, ~31
   19    42        INIT_FCALL                                               'strtolower'
         43        SEND_VAR                                                 !7
         44        DO_ICALL                                         $33     
         45        ASSIGN                                                   !8, $33
   21    46        FETCH_DIM_R                                      ~35     !1, !6
         47        FETCH_DIM_R                                      ~36     ~35, 'desc'
         48        ASSIGN                                                   !9, ~36
   22    49        INIT_FCALL                                               'strtolower'
         50        SEND_VAR                                                 !9
         51        DO_ICALL                                         $38     
         52        ASSIGN                                                   !10, $38
   24    53        INIT_FCALL                                               'strpos'
         54        SEND_VAR                                                 !10
         55        SEND_VAL                                                 '%2A'
         56        DO_ICALL                                         $40     
         57        TYPE_CHECK                                  1018          $40
         58      > JMPZ                                                     ~41, ->61
   25    59    >   ASSIGN                                                   !9, 'Live'
         60      > JMP                                                      ->62
   27    61    >   ASSIGN                                                   !9, '+Not+Live'
   29    62    >   CONCAT                                           ~44     !7, '%0A'
         63        ECHO                                                     ~44
   30    64        CONCAT                                           ~45     !9, '%0A'
         65        ECHO                                                     ~45
   31    66        PRE_INC                                                  !2
   17    67        PRE_INC                                                  !6
         68    >   IS_SMALLER                                               !6, !5
         69      > JMPNZ                                                    ~48, ->39
   34    70    >   IS_EQUAL                                                 !2, 0
         71      > JMPZ                                                     ~49, ->76
   35    72    >   FETCH_DIM_R                                      ~50     !1, !6
         73        FETCH_DIM_R                                      ~51     ~50, 'title'
         74        FETCH_DIM_R                                      ~52     ~51, 0
         75        ECHO                                                     ~52
   37    76    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.54 ms | 1392 KiB | 19 Q