3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0"?> <a> <b> <c> <value attr="Some Attr">Some Value</value> </c> </b> </a> XML; $a = new SimpleXMLElement($xml); if ($a->xpath('/a/b')) { echo 'Node is not empty'; } else { echo 'Node is empty'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k1dC1
function name:  (null)
number of ops:  13
compiled vars:  !0 = $xml, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Ca%3E%0A++++%3Cb%3E%0A++++++++%3Cc%3E%0A%09%09%09%3Cvalue+attr%3D%22Some+Attr%22%3ESome+Value%3C%2Fvalue%3E%0A%09%09%3C%2Fc%3E%0A++++%3C%2Fb%3E%0A%3C%2Fa%3E'
   14     1        NEW                                              $3      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   16     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2Fa%2Fb'
          7        DO_FCALL                                      0  $6      
          8      > JMPZ                                                     $6, ->11
   17     9    >   ECHO                                                     'Node+is+not+empty'
         10      > JMP                                                      ->12
   19    11    >   ECHO                                                     'Node+is+empty'
   20    12    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.74 ms | 1384 KiB | 13 Q