3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = new SimpleXMLElement('<items><item action="preview" /></items>'); foreach ($xml->xpath('/items/item') as $item) { var_dump($item); var_dump($item->xpath("(.)[@action='preview']/@action")); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/vvg0h
function name:  (null)
number of ops:  21
compiled vars:  !0 = $xml, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'SimpleXMLElement'
          1        SEND_VAL_EX                                              '%3Citems%3E%3Citem+action%3D%22preview%22+%2F%3E%3C%2Fitems%3E'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    5     4        INIT_METHOD_CALL                                         !0, 'xpath'
          5        SEND_VAL_EX                                              '%2Fitems%2Fitem'
          6        DO_FCALL                                      0  $5      
          7      > FE_RESET_R                                       $6      $5, ->19
          8    > > FE_FETCH_R                                               $6, !1, ->19
    6     9    >   INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
    7    12        INIT_FCALL                                               'var_dump'
         13        INIT_METHOD_CALL                                         !1, 'xpath'
         14        SEND_VAL_EX                                              '%28.%29%5B%40action%3D%27preview%27%5D%2F%40action'
         15        DO_FCALL                                      0  $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                                 
    5    18      > JMP                                                      ->8
         19    >   FE_FREE                                                  $6
    8    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.98 ms | 1395 KiB | 15 Q