3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<ENDBLOCK <block> <key1>value1</key1> <key2>value2</key2> <key3>value3</key3> </block> ENDBLOCK; $sxml = simplexml_load_string($xml); foreach($sxml->children() as $key => $val) { printf("%s => %s %s empty\n", (string)$key, (string)$val, (empty($val) ? 'evaluates as' : 'is not')); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 24
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 24
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/tfJ8o
function name:  (null)
number of ops:  26
compiled vars:  !0 = $xml, !1 = $sxml, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cblock%3E%0A+++%3Ckey1%3Evalue1%3C%2Fkey1%3E%0A+++%3Ckey2%3Evalue2%3C%2Fkey2%3E%0A+++%3Ckey3%3Evalue3%3C%2Fkey3%3E%0A%3C%2Fblock%3E'
   11     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
   12     5        INIT_METHOD_CALL                                         !1, 'children'
          6        DO_FCALL                                      0  $7      
          7      > FE_RESET_R                                       $8      $7, ->24
          8    > > FE_FETCH_R                                       ~9      $8, !2, ->24
          9    >   ASSIGN                                                   !3, ~9
   13    10        INIT_FCALL                                               'printf'
         11        SEND_VAL                                                 '%25s+%3D%3E+%25s+%25s+empty%0A'
         12        CAST                                          6  ~11     !3
         13        SEND_VAL                                                 ~11
         14        CAST                                          6  ~12     !2
         15        SEND_VAL                                                 ~12
         16        ISSET_ISEMPTY_CV                                         !2
         17      > JMPZ                                                     ~13, ->20
         18    >   QM_ASSIGN                                        ~14     'evaluates+as'
         19      > JMP                                                      ->21
         20    >   QM_ASSIGN                                        ~14     'is+not'
         21    >   SEND_VAL                                                 ~14
         22        DO_ICALL                                                 
   12    23      > JMP                                                      ->8
         24    >   FE_FREE                                                  $8
   14    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.41 ms | 1388 KiB | 17 Q