3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.04 ms | 1393 KiB | 13 Q