3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str=<<<XML <scales> <scale id="1" gender="*" age="*"> <d>5</d> <d>9</d> </scale> <scale id="2" gender="m" age="*"> <d>3</d> <d>0</d> </scale> <scale id="3" gender="*" age="19-39"> <d>12</d> <d>19</d> </scale> </scales> XML; $xml=simplexml_load_string($str); $result=$xml->xpath('//scale[@gender="*" or @gender="m"][@age="*" or @age="39-59"]'); foreach($result as $node) { echo $node->id."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/tX7Co
function name:  (null)
number of ops:  17
compiled vars:  !0 = $str, !1 = $xml, !2 = $result, !3 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cscales%3E%0A++++%3Cscale+id%3D%221%22+gender%3D%22%2A%22+age%3D%22%2A%22%3E%0A++++++++%3Cd%3E5%3C%2Fd%3E%0A++++++++%3Cd%3E9%3C%2Fd%3E%0A++++%3C%2Fscale%3E%0A++++%3Cscale+id%3D%222%22+gender%3D%22m%22+age%3D%22%2A%22%3E%0A++++++++%3Cd%3E3%3C%2Fd%3E%0A++++++++%3Cd%3E0%3C%2Fd%3E%0A++++%3C%2Fscale%3E%0A++++%3Cscale+id%3D%223%22+gender%3D%22%2A%22+age%3D%2219-39%22%3E%0A++++++++%3Cd%3E12%3C%2Fd%3E%0A++++++++%3Cd%3E19%3C%2Fd%3E%0A++++%3C%2Fscale%3E%0A%3C%2Fscales%3E'
   18     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
   19     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2F%2Fscale%5B%40gender%3D%22%2A%22+or+%40gender%3D%22m%22%5D%5B%40age%3D%22%2A%22+or+%40age%3D%2239-59%22%5D'
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !2, $7
   20     9      > FE_RESET_R                                       $9      !2, ->15
         10    > > FE_FETCH_R                                               $9, !3, ->15
   22    11    >   FETCH_OBJ_R                                      ~10     !3, 'id'
         12        CONCAT                                           ~11     ~10, '%0A'
         13        ECHO                                                     ~11
   20    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $9
   23    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.11 ms | 1395 KiB | 15 Q