3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlstr = <<<XML <?xml version='1.0' standalone='yes'?> <errors> <error code="1">movie 1</error> <error code="2">movie 2</error> </errors> XML; $errors = new SimpleXMLElement($xmlstr); foreach($errors->children() as $error) { foreach($error->attributes() as $k=>$v) { var_dump($k, (string)$v); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 20
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 20
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 20
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/re3km
function name:  (null)
number of ops:  24
compiled vars:  !0 = $xmlstr, !1 = $errors, !2 = $error, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%271.0%27+standalone%3D%27yes%27%3F%3E%0A%3Cerrors%3E%0A+%3Cerror+code%3D%221%22%3Emovie+1%3C%2Ferror%3E%0A+%3Cerror+code%3D%222%22%3Emovie+2%3C%2Ferror%3E%0A%3C%2Ferrors%3E'
   11     1        NEW                                              $6      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
   13     5        INIT_METHOD_CALL                                         !1, 'children'
          6        DO_FCALL                                      0  $9      
          7      > FE_RESET_R                                       $10     $9, ->22
          8    > > FE_FETCH_R                                               $10, !2, ->22
   15     9    >   INIT_METHOD_CALL                                         !2, 'attributes'
         10        DO_FCALL                                      0  $11     
         11      > FE_RESET_R                                       $12     $11, ->20
         12    > > FE_FETCH_R                                       ~13     $12, !3, ->20
         13    >   ASSIGN                                                   !4, ~13
   17    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !4
         16        CAST                                          6  ~15     !3
         17        SEND_VAL                                                 ~15
         18        DO_ICALL                                                 
   15    19      > JMP                                                      ->12
         20    >   FE_FREE                                                  $12
   13    21      > JMP                                                      ->8
         22    >   FE_FREE                                                  $10
   19    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
206.99 ms | 1396 KiB | 15 Q