3v4l.org

run code in 300+ PHP versions simultaneously
<?php class XMLCreator { private $data = Array ( "zipcode" => "95610", "city" => "Citrus Heights", "icao" => "KMCC", "ccobst" => "McClellan Airfield", "obdist" => 7.3067011821565, "oblat" => 38.667, "oblong" => -121.4, ); function __construct() { $this->generate_xml_element(); } function __destruct() { } function generate_xml_element() { $doc = new DOMDocument(); // we want a nice output $doc->formatOutput = true; $root = $doc->createElement('address'); $root = $doc->appendChild($root); foreach ($this->data as $key => $value) { $title = $doc->createElement($key); $title = $root->appendChild($title); $text = $doc->createTextNode($value); $text = $title->appendChild($text); } echo "Saving all the document:\n"; echo $doc->saveXML() . "\n"; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W49VC
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E > > RETURN                                                   1

Class XMLCreator:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W49VC
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_METHOD_CALL                                         'generate_xml_element'
          1        DO_FCALL                                      0          
   17     2      > RETURN                                                   null

End of function __construct

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W49VC
function name:  __destruct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E > > RETURN                                                   null

End of function __destruct

Function generate_xml_element:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 34
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 34
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/W49VC
function name:  generate_xml_element
number of ops:  41
compiled vars:  !0 = $doc, !1 = $root, !2 = $value, !3 = $key, !4 = $title, !5 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $6      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $6
   27     3        ASSIGN_OBJ                                               !0, 'formatOutput'
          4        OP_DATA                                                  <true>
   28     5        INIT_METHOD_CALL                                         !0, 'createElement'
          6        SEND_VAL_EX                                              'address'
          7        DO_FCALL                                      0  $10     
          8        ASSIGN                                                   !1, $10
   29     9        INIT_METHOD_CALL                                         !0, 'appendChild'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0  $12     
         12        ASSIGN                                                   !1, $12
   30    13        FETCH_OBJ_R                                      ~14     'data'
         14      > FE_RESET_R                                       $15     ~14, ->34
         15    > > FE_FETCH_R                                       ~16     $15, !2, ->34
         16    >   ASSIGN                                                   !3, ~16
   32    17        INIT_METHOD_CALL                                         !0, 'createElement'
         18        SEND_VAR_EX                                              !3
         19        DO_FCALL                                      0  $18     
         20        ASSIGN                                                   !4, $18
   33    21        INIT_METHOD_CALL                                         !1, 'appendChild'
         22        SEND_VAR_EX                                              !4
         23        DO_FCALL                                      0  $20     
         24        ASSIGN                                                   !4, $20
   34    25        INIT_METHOD_CALL                                         !0, 'createTextNode'
         26        SEND_VAR_EX                                              !2
         27        DO_FCALL                                      0  $22     
         28        ASSIGN                                                   !5, $22
   35    29        INIT_METHOD_CALL                                         !4, 'appendChild'
         30        SEND_VAR_EX                                              !5
         31        DO_FCALL                                      0  $24     
         32        ASSIGN                                                   !5, $24
   30    33      > JMP                                                      ->15
         34    >   FE_FREE                                                  $15
   38    35        ECHO                                                     'Saving+all+the+document%3A%0A'
   39    36        INIT_METHOD_CALL                                         !0, 'saveXML'
         37        DO_FCALL                                      0  $26     
         38        CONCAT                                           ~27     $26, '%0A'
         39        ECHO                                                     ~27
   40    40      > RETURN                                                   null

End of function generate_xml_element

End of class XMLCreator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.58 ms | 1399 KiB | 13 Q