3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( 'id' => 1, 'name' => 'Jacopo', 'male' => true, 'birthday' => new DateTime('1988-07-26'), 'hobbies' => array( 'Programming', 'TV Shows', 'Skiing' ) ); $xml = new SimpleXMLElement('<root/>'); array_walk_recursive($a, array ($xml, 'addChild')); print $xml->asXML();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KgWjt
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a, !1 = $xml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_ARRAY                                       ~2      1, 'id'
    4     1        ADD_ARRAY_ELEMENT                                ~2      'Jacopo', 'name'
    3     2        ADD_ARRAY_ELEMENT                                ~2      <true>, 'male'
    6     3        NEW                                              $3      'DateTime'
          4        SEND_VAL_EX                                              '1988-07-26'
          5        DO_FCALL                                      0          
          6        ADD_ARRAY_ELEMENT                                ~2      $3, 'birthday'
    3     7        ADD_ARRAY_ELEMENT                                ~2      <array>, 'hobbies'
    2     8        ASSIGN                                                   !0, ~2
   14     9        NEW                                              $6      'SimpleXMLElement'
         10        SEND_VAL_EX                                              '%3Croot%2F%3E'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $6
   15    13        INIT_FCALL                                               'array_walk_recursive'
         14        SEND_REF                                                 !0
         15        INIT_ARRAY                                       ~9      !1
         16        ADD_ARRAY_ELEMENT                                ~9      'addChild'
         17        SEND_VAL                                                 ~9
         18        DO_ICALL                                                 
   16    19        INIT_METHOD_CALL                                         !1, 'asXML'
         20        DO_FCALL                                      0  $11     
         21        ECHO                                                     $11
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.5 ms | 1395 KiB | 15 Q