3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0"?> <a> <b> <c> <value>Some Value</value> <t2>sds</t2> </c> </b> </a> XML; $a = new SimpleXMLElement($xml); $nodes = $a->xpath('/a/b/c/value'); $node = $nodes[0]; if ($node) { echo "Element is not empty"; } else { echo "Element is empty"; } $nodes = $a->xpath('/a/b/c/t2'); $node = $nodes[0]; 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 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
Branch analysis from position: 24
filename:       /in/cSP6A
function name:  (null)
number of ops:  26
compiled vars:  !0 = $xml, !1 = $a, !2 = $nodes, !3 = $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%3Ct2%3Esds%3C%2Ft2%3E%0A++++++++%3C%2Fc%3E%0A++++%3C%2Fb%3E%0A%3C%2Fa%3E'
   14     1        NEW                                              $5      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
   16     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2Fa%2Fb%2Fc%2Fvalue'
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !2, $8
   17     9        FETCH_DIM_R                                      ~10     !2, 0
         10        ASSIGN                                                   !3, ~10
   18    11      > JMPZ                                                     !3, ->14
   19    12    >   ECHO                                                     'Element+is+not+empty'
         13      > JMP                                                      ->15
   21    14    >   ECHO                                                     'Element+is+empty'
   24    15    >   INIT_METHOD_CALL                                         !1, 'xpath'
         16        SEND_VAL_EX                                              '%2Fa%2Fb%2Fc%2Ft2'
         17        DO_FCALL                                      0  $12     
         18        ASSIGN                                                   !2, $12
   25    19        FETCH_DIM_R                                      ~14     !2, 0
         20        ASSIGN                                                   !3, ~14
   26    21      > JMPZ                                                     !3, ->24
   27    22    >   ECHO                                                     'Element+is+not+empty'
         23      > JMP                                                      ->25
   29    24    >   ECHO                                                     'Element+is+empty'
   30    25    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.87 ms | 1395 KiB | 13 Q