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); $result=$xml->xpath('//d[@scid="hi"][@raw="10"]'); //$result=$xml->xpath('//scale[@gender="*" or @gender="m"][@age="*" or @age="39-59"]'); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2IkDn
function name:  (null)
number of ops:  13
compiled vars:  !0 = $str, !1 = $xml, !2 = $result
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%2Fd%5B%40scid%3D%22hi%22%5D%5B%40raw%3D%2210%22%5D'
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !2, $6
   22     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.44 ms | 1395 KiB | 17 Q