3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = 'bar'; print "regular string ... "; var_dump(empty($foo)); #Should be false $xml = simplexml_load_string("<xml><something>somevalue</something></xml>"); $xml2 = simplexml_load_string("<xml>\n<something>somevalue</something>\n</xml>"); foreach($xml as $key => $value) { print "$key = $value ... "; var_dump(empty($value)); # Should be false var_dump($value == false); # Should be false } foreach($xml2 as $key => $value) { print "$key = $value ... "; var_dump(empty($value)); # Should be false, but isn't var_dump($value == false); # Should be false } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 31
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 31
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 31
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 49
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 49
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
Branch analysis from position: 31
filename:       /in/rr1ir
function name:  (null)
number of ops:  51
compiled vars:  !0 = $foo, !1 = $xml, !2 = $xml2, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'bar'
    3     1        ECHO                                                     'regular+string+...+'
    4     2        INIT_FCALL                                               'var_dump'
          3        ISSET_ISEMPTY_CV                                 ~6      !0
          4        SEND_VAL                                                 ~6
          5        DO_ICALL                                                 
    6     6        INIT_FCALL                                               'simplexml_load_string'
          7        SEND_VAL                                                 '%3Cxml%3E%3Csomething%3Esomevalue%3C%2Fsomething%3E%3C%2Fxml%3E'
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !1, $8
    7    10        INIT_FCALL                                               'simplexml_load_string'
         11        SEND_VAL                                                 '%3Cxml%3E%0A%3Csomething%3Esomevalue%3C%2Fsomething%3E%0A%3C%2Fxml%3E'
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !2, $10
    9    14      > FE_RESET_R                                       $12     !1, ->31
         15    > > FE_FETCH_R                                       ~13     $12, !3, ->31
         16    >   ASSIGN                                                   !4, ~13
   10    17        ROPE_INIT                                     4  ~16     !4
         18        ROPE_ADD                                      1  ~16     ~16, '+%3D+'
         19        ROPE_ADD                                      2  ~16     ~16, !3
         20        ROPE_END                                      3  ~15     ~16, '+...+'
         21        ECHO                                                     ~15
   11    22        INIT_FCALL                                               'var_dump'
         23        ISSET_ISEMPTY_CV                                 ~18     !3
         24        SEND_VAL                                                 ~18
         25        DO_ICALL                                                 
   12    26        INIT_FCALL                                               'var_dump'
         27        BOOL_NOT                                         ~20     !3
         28        SEND_VAL                                                 ~20
         29        DO_ICALL                                                 
    9    30      > JMP                                                      ->15
         31    >   FE_FREE                                                  $12
   15    32      > FE_RESET_R                                       $22     !2, ->49
         33    > > FE_FETCH_R                                       ~23     $22, !3, ->49
         34    >   ASSIGN                                                   !4, ~23
   16    35        ROPE_INIT                                     4  ~26     !4
         36        ROPE_ADD                                      1  ~26     ~26, '+%3D+'
         37        ROPE_ADD                                      2  ~26     ~26, !3
         38        ROPE_END                                      3  ~25     ~26, '+...+'
         39        ECHO                                                     ~25
   17    40        INIT_FCALL                                               'var_dump'
         41        ISSET_ISEMPTY_CV                                 ~28     !3
         42        SEND_VAL                                                 ~28
         43        DO_ICALL                                                 
   18    44        INIT_FCALL                                               'var_dump'
         45        BOOL_NOT                                         ~30     !3
         46        SEND_VAL                                                 ~30
         47        DO_ICALL                                                 
   15    48      > JMP                                                      ->33
         49    >   FE_FREE                                                  $22
   20    50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.2 ms | 1400 KiB | 17 Q