3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str=<<<XML <scales> <scale id="1" gender="*" age="*"> <d scid="hi" raw="10" t="76" /> <d scid="pn" raw="12" t="80" /> </scale> <scale id="2" gender="m" age="*"> <d scid="hi" raw="8" t="79" /> <d scid="pn" raw="2" t="50" /> </scale> <scale id="3" gender="*" age="19-39"> <d scid="hi" raw="0" t="48" /> <d scid="pn" raw="10" t="49" /> </scale> </scales> XML; $xml=simplexml_load_string($str); foreach($xml->xpath('//scale[@gender="*" or @gender="m"][@age="*" or @age="39-59"]/d[@scid="hi"][@raw="10"]/@t') as $t) { echo $t->raw; echo $t->t; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/dDWqb
function name:  (null)
number of ops:  17
compiled vars:  !0 = $str, !1 = $xml, !2 = $t
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+scid%3D%22hi%22+raw%3D%2210%22+t%3D%2276%22+%2F%3E%0A++++++++%3Cd+scid%3D%22pn%22+raw%3D%2212%22+t%3D%2280%22+%2F%3E%0A++++%3C%2Fscale%3E%0A++++%3Cscale+id%3D%222%22+gender%3D%22m%22+age%3D%22%2A%22%3E%0A++++++++%3Cd+scid%3D%22hi%22+raw%3D%228%22+t%3D%2279%22+%2F%3E%0A++++++++%3Cd+scid%3D%22pn%22+raw%3D%222%22+t%3D%2250%22+%2F%3E%0A++++%3C%2Fscale%3E%0A++++%3Cscale+id%3D%223%22+gender%3D%22%2A%22+age%3D%2219-39%22%3E%0A++++++++%3Cd+scid%3D%22hi%22+raw%3D%220%22+t%3D%2248%22+%2F%3E%0A++++++++%3Cd+scid%3D%22pn%22+raw%3D%2210%22+t%3D%2249%22+%2F%3E%0A++++%3C%2Fscale%3E%0A%3C%2Fscales%3E'
   18     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   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%2Fd%5B%40scid%3D%22hi%22%5D%5B%40raw%3D%2210%22%5D%2F%40t'
          7        DO_FCALL                                      0  $6      
          8      > FE_RESET_R                                       $7      $6, ->15
          9    > > FE_FETCH_R                                               $7, !2, ->15
   21    10    >   FETCH_OBJ_R                                      ~8      !2, 'raw'
         11        ECHO                                                     ~8
   22    12        FETCH_OBJ_R                                      ~9      !2, 't'
         13        ECHO                                                     ~9
   19    14      > JMP                                                      ->9
         15    >   FE_FREE                                                  $7
   23    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.38 ms | 1387 KiB | 15 Q