3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = new SimpleXMLElement('<foo bar="baz"></foo>'); function iterator(SimpleXMLElement $xml): iterable { foreach ($xml->children() as $img) { yield $img["src"] ?? ""; } } iterator_to_array(iterator($xml->bar));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rqvMc
function name:  (null)
number of ops:  12
compiled vars:  !0 = $xml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'SimpleXMLElement'
          1        SEND_VAL_EX                                              '%3Cfoo+bar%3D%22baz%22%3E%3C%2Ffoo%3E'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   11     4        INIT_FCALL                                               'iterator_to_array'
          5        INIT_FCALL                                               'iterator'
          6        FETCH_OBJ_R                                      ~4      !0, 'bar'
          7        SEND_VAL                                                 ~4
          8        DO_FCALL                                      0  $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function iterator:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 11
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 11
filename:       /in/rqvMc
function name:  iterator
number of ops:  13
compiled vars:  !0 = $xml, !1 = $img
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
    6     2        INIT_METHOD_CALL                                         !0, 'children'
          3        DO_FCALL                                      0  $2      
          4      > FE_RESET_R                                       $3      $2, ->11
          5    > > FE_FETCH_R                                               $3, !1, ->11
    7     6    >   FETCH_DIM_IS                                     ~4      !1, 'src'
          7        COALESCE                                         ~5      ~4
          8        QM_ASSIGN                                        ~5      ''
          9        YIELD                                                    ~5
    6    10      > JMP                                                      ->5
         11    >   FE_FREE                                                  $3
    9    12      > GENERATOR_RETURN                                         

End of function iterator

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.48 ms | 1403 KiB | 16 Q