3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if(!class_exists('SimpleXMLElement')) die("Bonkers"); $xml = new SimpleXMLElement('<xml xmlns:abstract="urn:my.org:abstract"><abstract:node>foo</abstract:node></xml>'); var_dump($xml->node); var_dump(gettype($xml->node)); var_dump(isset($xml->node)); var_dump(empty($xml->node)); var_dump(is_null($xml->node)); var_dump(count($xml->node)); var_dump(count($xml->node->children())); echo "----------------------\n"; var_dump(gettype($xml->node->foo)); var_dump(isset($xml->node->foo)); var_dump(empty($xml->node->foo)); var_dump(is_null($xml->node->foo)); var_dump(count($xml->node->foo)); var_dump(count($xml->node->foo->children()));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DjhdJ
function name:  (null)
number of ops:  82
compiled vars:  !0 = $xml
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   INIT_FCALL                                               'class_exists'
         1        SEND_VAL                                                 'SimpleXMLElement'
         2        DO_ICALL                                         $1      
         3        BOOL_NOT                                         ~2      $1
         4      > JMPZ                                                     ~2, ->6
         5    > > EXIT                                                     'Bonkers'
   3     6    >   NEW                                              $3      :-2
         7        SEND_VAL_EX                                              '%3Cxml+xmlns%3Aabstract%3D%22urn%3Amy.org%3Aabstract%22%3E%3Cabstract%3Anode%3Efoo%3C%2Fabstract%3Anode%3E%3C%2Fxml%3E'
         8        DO_FCALL                                      0          
         9        ASSIGN                                                   !0, $3
   4    10        INIT_FCALL                                               'var_dump'
        11        FETCH_OBJ_R                                      $6      !0, 'node'
        12        SEND_VAR                                                 $6
        13        DO_ICALL                                                 
   6    14        INIT_FCALL                                               'var_dump'
        15        FETCH_OBJ_R                                      $8      !0, 'node'
        16        GET_TYPE                                         ~9      $8
        17        SEND_VAL                                                 ~9
        18        DO_ICALL                                                 
   7    19        INIT_FCALL                                               'var_dump'
        20        ISSET_ISEMPTY_PROP_OBJ                           ~11     !0, 'node'
        21        SEND_VAL                                                 ~11
        22        DO_ICALL                                                 
   8    23        INIT_FCALL                                               'var_dump'
        24        ISSET_ISEMPTY_PROP_OBJ                           ~13     !0, 'node'
        25        SEND_VAL                                                 ~13
        26        DO_ICALL                                                 
   9    27        INIT_FCALL                                               'var_dump'
        28        FETCH_OBJ_R                                      $15     !0, 'node'
        29        TYPE_CHECK                                    1  ~16     $15
        30        SEND_VAL                                                 ~16
        31        DO_ICALL                                                 
  10    32        INIT_FCALL                                               'var_dump'
        33        FETCH_OBJ_R                                      $18     !0, 'node'
        34        COUNT                                            ~19     $18
        35        SEND_VAL                                                 ~19
        36        DO_ICALL                                                 
  11    37        INIT_FCALL                                               'var_dump'
        38        FETCH_OBJ_R                                      $21     !0, 'node'
        39        INIT_METHOD_CALL                                         $21, 'children'
        40        DO_FCALL                                      0  $22     
        41        COUNT                                            ~23     $22
        42        SEND_VAL                                                 ~23
        43        DO_ICALL                                                 
  12    44        ECHO                                                     '----------------------%0A'
  13    45        INIT_FCALL                                               'var_dump'
        46        FETCH_OBJ_R                                      $25     !0, 'node'
        47        FETCH_OBJ_R                                      $26     $25, 'foo'
        48        GET_TYPE                                         ~27     $26
        49        SEND_VAL                                                 ~27
        50        DO_ICALL                                                 
  14    51        INIT_FCALL                                               'var_dump'
        52        FETCH_OBJ_IS                                     $29     !0, 'node'
        53        ISSET_ISEMPTY_PROP_OBJ                           ~30     $29, 'foo'
        54        SEND_VAL                                                 ~30
        55        DO_ICALL                                                 
  15    56        INIT_FCALL                                               'var_dump'
        57        FETCH_OBJ_IS                                     $32     !0, 'node'
        58        ISSET_ISEMPTY_PROP_OBJ                           ~33     $32, 'foo'
        59        SEND_VAL                                                 ~33
        60        DO_ICALL                                                 
  16    61        INIT_FCALL                                               'var_dump'
        62        FETCH_OBJ_R                                      $35     !0, 'node'
        63        FETCH_OBJ_R                                      $36     $35, 'foo'
        64        TYPE_CHECK                                    1  ~37     $36
        65        SEND_VAL                                                 ~37
        66        DO_ICALL                                                 
  17    67        INIT_FCALL                                               'var_dump'
        68        FETCH_OBJ_R                                      $39     !0, 'node'
        69        FETCH_OBJ_R                                      $40     $39, 'foo'
        70        COUNT                                            ~41     $40
        71        SEND_VAL                                                 ~41
        72        DO_ICALL                                                 
  18    73        INIT_FCALL                                               'var_dump'
        74        FETCH_OBJ_R                                      $43     !0, 'node'
        75        FETCH_OBJ_R                                      $44     $43, 'foo'
        76        INIT_METHOD_CALL                                         $44, 'children'
        77        DO_FCALL                                      0  $45     
        78        COUNT                                            ~46     $45
        79        SEND_VAL                                                 ~46
        80        DO_ICALL                                                 
        81      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0