3v4l.org

run code in 300+ PHP versions simultaneously
<?php $row = array( 'entity_id' => "14", 'entity_type_id' => "1", 'attribute_set_id' => "0", 'website_id' => "1", 'email' => "office@solarpower-augsburg.de", 'group_id' => "1", 'increment_id' => "000000011", 'store_id' => "0", 'created_at' => "2013-10-22 10:28:59", 'updated_at' => "2013-10-22 10:51:50", 'is_active' => "1", 'disable_auto_group_change' => "0", 'prefix' => "Herr", 'firstname' => "Gabriele ", 'middlename' => NULL, 'lastname' => "Ament", 'suffix' => "Solarpower Energy for Life", 'name' => "Herr Gabriele Ament Solarpower Energy for Life", 'is_partner' => "1", 'default_billing' => "16", 'billing_firstname' => "Gabriele ", 'billing_lastname' => "Ament", 'billing_postcode' => "86199", 'billing_city' => "Augsburg", 'billing_telephone' => "0821·90732-50", 'billing_country_id' => "DE", 'billing_street' => "Zum Fuggerschloß 38", 'billing_region' => "Bayern", 'billing_company' => "Solarpower Energy for Life Gabriele Ament e.K.", 'tom_geo_latitude' => "48.3237705", 'tom_geo_longitude' => "10.8221745", ); $dom = new DOMDocument("1.0","UTF-8"); $node = $dom->createElement("Markers"); $parnode = $dom->appendChild($node); foreach ($row as $key => $value) { $address = $value['billing_street'] .','. $value['billing_country_id'] .'-'. $value['billing_postcode'] .' '. $value['billing_city']; $distance = 6371 * acos( cos( deg2rad($qryVal[0]) ) * cos( deg2rad( $value['tom_geo_latitude'] ) ) * cos( deg2rad( $value['tom_geo_longitude'] ) - deg2rad($qryVal[1]) ) + sin( deg2rad($qryVal[0]) ) * sin(deg2rad( $value['tom_geo_latitude'] ) ) ); $contactPerson = $value['billing_firstname'] .' '. $value['billing_lastname']; // ADD TO XML DOCUMENT NODE $marker = $dom->createElement("Marker"); $newnode = $parnode->appendChild($marker); $newnode->setAttribute("StoreId", $value['store_id']); $newnode->setAttribute("Lat", $value['tom_geo_latitude']); $newnode->setAttribute("Lng", $value['tom_geo_longitude']); $newnode->setAttribute("Distance", $distance); $newnode->setAttribute("ImgUrl", $key['ImgUrl']); $newnode->setAttribute("CategoryIcon", '/skin/frontend/default/solarinvert/tom/dealer/default.png'); $newnode->setAttribute("Contactperson", $contactPerson); $newnode->setAttribute("Phone", $value['billing_telephone']); $newnode->setAttribute("Logo", $value['logo']); /* $newnode->setAttribute("Country", $value['billing_country_id']); $newnode->setAttribute("Fax", $value['billing_fax']); $newnode->setAttribute("Address", $address); $newnode->setAttribute("Type", $value['Type']); $newnode->setAttribute("Email", $value['email']); $newnode->setAttribute("Website", $value['Website']); $newnode->setAttribute("State", $value['billing_region']); $newnode->setAttribute("City", $value['billing_city']); $newnode->setAttribute("Name", $value['billing_company']); */ // $newnode->setAttribute("LabelId", $key['LabelId']); // $newnode->setAttribute("LabelText", $key['LabelText']); // $newnode->setAttribute("Google", $key['Google']); // $newnode->setAttribute("Facebook", $key['Facebook']); // $newnode->setAttribute("Twitter", $key['Twitter']); // $newnode->setAttribute("Printrest", $key['Printrest']); // $newnode->setAttribute("Gallery", $row['Gallery']); // $newnode->setAttribute("Info", $row['Info']); // $newnode->setAttribute("Working", $row['Working']); // $newnode->setAttribute("Video", $row['Video']); // $newnode->setAttribute("Direction", $row['Direction']); } echo $dom->saveXML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 139
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 139
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 139
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 139
filename:       /in/HrY57
function name:  (null)
number of ops:  144
compiled vars:  !0 = $row, !1 = $dom, !2 = $node, !3 = $parnode, !4 = $value, !5 = $key, !6 = $address, !7 = $distance, !8 = $qryVal, !9 = $contactPerson, !10 = $marker, !11 = $newnode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   68     1        NEW                                              $13     'DOMDocument'
          2        SEND_VAL_EX                                              '1.0'
          3        SEND_VAL_EX                                              'UTF-8'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $13
   69     6        INIT_METHOD_CALL                                         !1, 'createElement'
          7        SEND_VAL_EX                                              'Markers'
          8        DO_FCALL                                      0  $16     
          9        ASSIGN                                                   !2, $16
   70    10        INIT_METHOD_CALL                                         !1, 'appendChild'
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0  $18     
         13        ASSIGN                                                   !3, $18
   72    14      > FE_RESET_R                                       $20     !0, ->139
         15    > > FE_FETCH_R                                       ~21     $20, !4, ->139
         16    >   ASSIGN                                                   !5, ~21
   74    17        FETCH_DIM_R                                      ~23     !4, 'billing_street'
         18        CONCAT                                           ~24     ~23, '%2C'
         19        FETCH_DIM_R                                      ~25     !4, 'billing_country_id'
         20        CONCAT                                           ~26     ~24, ~25
         21        CONCAT                                           ~27     ~26, '-'
         22        FETCH_DIM_R                                      ~28     !4, 'billing_postcode'
         23        CONCAT                                           ~29     ~27, ~28
         24        CONCAT                                           ~30     ~29, '+'
         25        FETCH_DIM_R                                      ~31     !4, 'billing_city'
         26        CONCAT                                           ~32     ~30, ~31
         27        ASSIGN                                                   !6, ~32
   75    28        INIT_FCALL                                               'acos'
         29        INIT_FCALL                                               'cos'
         30        INIT_FCALL                                               'deg2rad'
         31        FETCH_DIM_R                                      ~34     !8, 0
         32        SEND_VAL                                                 ~34
         33        DO_ICALL                                         $35     
         34        SEND_VAR                                                 $35
         35        DO_ICALL                                         $36     
         36        INIT_FCALL                                               'cos'
         37        INIT_FCALL                                               'deg2rad'
         38        FETCH_DIM_R                                      ~37     !4, 'tom_geo_latitude'
         39        SEND_VAL                                                 ~37
         40        DO_ICALL                                         $38     
         41        SEND_VAR                                                 $38
         42        DO_ICALL                                         $39     
         43        MUL                                              ~40     $36, $39
         44        INIT_FCALL                                               'cos'
         45        INIT_FCALL                                               'deg2rad'
         46        FETCH_DIM_R                                      ~41     !4, 'tom_geo_longitude'
         47        SEND_VAL                                                 ~41
         48        DO_ICALL                                         $42     
         49        INIT_FCALL                                               'deg2rad'
         50        FETCH_DIM_R                                      ~43     !8, 1
         51        SEND_VAL                                                 ~43
         52        DO_ICALL                                         $44     
         53        SUB                                              ~45     $42, $44
         54        SEND_VAL                                                 ~45
         55        DO_ICALL                                         $46     
         56        MUL                                              ~47     $46, ~40
         57        INIT_FCALL                                               'sin'
         58        INIT_FCALL                                               'deg2rad'
         59        FETCH_DIM_R                                      ~48     !8, 0
         60        SEND_VAL                                                 ~48
         61        DO_ICALL                                         $49     
         62        SEND_VAR                                                 $49
         63        DO_ICALL                                         $50     
         64        INIT_FCALL                                               'sin'
         65        INIT_FCALL                                               'deg2rad'
         66        FETCH_DIM_R                                      ~51     !4, 'tom_geo_latitude'
         67        SEND_VAL                                                 ~51
         68        DO_ICALL                                         $52     
         69        SEND_VAR                                                 $52
         70        DO_ICALL                                         $53     
         71        MUL                                              ~54     $50, $53
         72        ADD                                              ~55     ~47, ~54
         73        SEND_VAL                                                 ~55
         74        DO_ICALL                                         $56     
         75        MUL                                              ~57     $56, 6371
         76        ASSIGN                                                   !7, ~57
   76    77        FETCH_DIM_R                                      ~59     !4, 'billing_firstname'
         78        CONCAT                                           ~60     ~59, '+'
         79        FETCH_DIM_R                                      ~61     !4, 'billing_lastname'
         80        CONCAT                                           ~62     ~60, ~61
         81        ASSIGN                                                   !9, ~62
   83    82        INIT_METHOD_CALL                                         !1, 'createElement'
         83        SEND_VAL_EX                                              'Marker'
         84        DO_FCALL                                      0  $64     
         85        ASSIGN                                                   !10, $64
   84    86        INIT_METHOD_CALL                                         !3, 'appendChild'
         87        SEND_VAR_EX                                              !10
         88        DO_FCALL                                      0  $66     
         89        ASSIGN                                                   !11, $66
   85    90        INIT_METHOD_CALL                                         !11, 'setAttribute'
         91        SEND_VAL_EX                                              'StoreId'
         92        CHECK_FUNC_ARG                                           
         93        FETCH_DIM_FUNC_ARG                               $68     !4, 'store_id'
         94        SEND_FUNC_ARG                                            $68
         95        DO_FCALL                                      0          
   86    96        INIT_METHOD_CALL                                         !11, 'setAttribute'
         97        SEND_VAL_EX                                              'Lat'
         98        CHECK_FUNC_ARG                                           
         99        FETCH_DIM_FUNC_ARG                               $70     !4, 'tom_geo_latitude'
        100        SEND_FUNC_ARG                                            $70
        101        DO_FCALL                                      0          
   87   102        INIT_METHOD_CALL                                         !11, 'setAttribute'
        103        SEND_VAL_EX                                              'Lng'
        104        CHECK_FUNC_ARG                                           
        105        FETCH_DIM_FUNC_ARG                               $72     !4, 'tom_geo_longitude'
        106        SEND_FUNC_ARG                                            $72
        107        DO_FCALL                                      0          
   88   108        INIT_METHOD_CALL                                         !11, 'setAttribute'
        109        SEND_VAL_EX                                              'Distance'
        110        SEND_VAR_EX                                              !7
        111        DO_FCALL                                      0          
   89   112        INIT_METHOD_CALL                                         !11, 'setAttribute'
        113        SEND_VAL_EX                                              'ImgUrl'
        114        CHECK_FUNC_ARG                                           
        115        FETCH_DIM_FUNC_ARG                               $75     !5, 'ImgUrl'
        116        SEND_FUNC_ARG                                            $75
        117        DO_FCALL                                      0          
   90   118        INIT_METHOD_CALL                                         !11, 'setAttribute'
        119        SEND_VAL_EX                                              'CategoryIcon'
        120        SEND_VAL_EX                                              '%2Fskin%2Ffrontend%2Fdefault%2Fsolarinvert%2Ftom%2Fdealer%2Fdefault.png'
        121        DO_FCALL                                      0          
   91   122        INIT_METHOD_CALL                                         !11, 'setAttribute'
        123        SEND_VAL_EX                                              'Contactperson'
        124        SEND_VAR_EX                                              !9
        125        DO_FCALL                                      0          
   92   126        INIT_METHOD_CALL                                         !11, 'setAttribute'
        127        SEND_VAL_EX                                              'Phone'
        128        CHECK_FUNC_ARG                                           
        129        FETCH_DIM_FUNC_ARG                               $79     !4, 'billing_telephone'
        130        SEND_FUNC_ARG                                            $79
        131        DO_FCALL                                      0          
   93   132        INIT_METHOD_CALL                                         !11, 'setAttribute'
        133        SEND_VAL_EX                                              'Logo'
        134        CHECK_FUNC_ARG                                           
        135        FETCH_DIM_FUNC_ARG                               $81     !4, 'logo'
        136        SEND_FUNC_ARG                                            $81
        137        DO_FCALL                                      0          
   72   138      > JMP                                                      ->15
        139    >   FE_FREE                                                  $20
  144   140        INIT_METHOD_CALL                                         !1, 'saveXML'
        141        DO_FCALL                                      0  $83     
        142        ECHO                                                     $83
        143      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.38 ms | 1408 KiB | 21 Q