3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0"?> <root><status>success</status> <duration>5 seconds</duration> <average>13692.4</average></root> XML; $reader = new XMLReader(); $reader->open('data://text/xml,' . $xml); while ($reader->read()) { if ($reader->name == 'average') { $value = $reader->readString(); if (!empty($value)) { var_dump($value); } } } $reader->close();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 9
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 21
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 9
Branch analysis from position: 24
Branch analysis from position: 9
Branch analysis from position: 21
Branch analysis from position: 21
filename:       /in/s7sNl
function name:  (null)
number of ops:  27
compiled vars:  !0 = $xml, !1 = $reader, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Croot%3E%3Cstatus%3Esuccess%3C%2Fstatus%3E%0A%3Cduration%3E5+seconds%3C%2Fduration%3E%0A%3Caverage%3E13692.4%3C%2Faverage%3E%3C%2Froot%3E'
   10     1        NEW                                              $4      'XMLReader'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
   11     4        INIT_METHOD_CALL                                         !1, 'open'
          5        CONCAT                                           ~7      'data%3A%2F%2Ftext%2Fxml%2C', !0
          6        SEND_VAL_EX                                              ~7
          7        DO_FCALL                                      0          
   12     8      > JMP                                                      ->21
   13     9    >   FETCH_OBJ_R                                      ~9      !1, 'name'
         10        IS_EQUAL                                                 ~9, 'average'
         11      > JMPZ                                                     ~10, ->21
   14    12    >   INIT_METHOD_CALL                                         !1, 'readString'
         13        DO_FCALL                                      0  $11     
         14        ASSIGN                                                   !2, $11
   15    15        ISSET_ISEMPTY_CV                                 ~13     !2
         16        BOOL_NOT                                         ~14     ~13
         17      > JMPZ                                                     ~14, ->21
   16    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
   12    21    >   INIT_METHOD_CALL                                         !1, 'read'
         22        DO_FCALL                                      0  $16     
         23      > JMPNZ                                                    $16, ->9
   21    24    >   INIT_METHOD_CALL                                         !1, 'close'
         25        DO_FCALL                                      0          
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.46 ms | 1401 KiB | 15 Q