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); $this->getResponse()->setHeader('Content-Type','text/xml','utf8'); 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 = 23, Position 2 = 147
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 147
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 147
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 147
filename:       /in/Su3DI
function name:  (null)
number of ops:  152
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
   71    14        FETCH_THIS                                       $20     
         15        INIT_METHOD_CALL                                         $20, 'getResponse'
         16        DO_FCALL                                      0  $21     
         17        INIT_METHOD_CALL                                         $21, 'setHeader'
         18        SEND_VAL_EX                                              'Content-Type'
         19        SEND_VAL_EX                                              'text%2Fxml'
         20        SEND_VAL_EX                                              'utf8'
         21        DO_FCALL                                      0          
   73    22      > FE_RESET_R                                       $23     !0, ->147
         23    > > FE_FETCH_R                                       ~24     $23, !4, ->147
         24    >   ASSIGN                                                   !5, ~24
   75    25        FETCH_DIM_R                                      ~26     !4, 'billing_street'
         26        CONCAT                                           ~27     ~26, '%2C'
         27        FETCH_DIM_R                                      ~28     !4, 'billing_country_id'
         28        CONCAT                                           ~29     ~27, ~28
         29        CONCAT                                           ~30     ~29, '-'
         30        FETCH_DIM_R                                      ~31     !4, 'billing_postcode'
         31        CONCAT                                           ~32     ~30, ~31
         32        CONCAT                                           ~33     ~32, '+'
         33        FETCH_DIM_R                                      ~34     !4, 'billing_city'
         34        CONCAT                                           ~35     ~33, ~34
         35        ASSIGN                                                   !6, ~35
   76    36        INIT_FCALL                                               'acos'
         37        INIT_FCALL                                               'cos'
         38        INIT_FCALL                                               'deg2rad'
         39        FETCH_DIM_R                                      ~37     !8, 0
         40        SEND_VAL                                                 ~37
         41        DO_ICALL                                         $38     
         42        SEND_VAR                                                 $38
         43        DO_ICALL                                         $39     
         44        INIT_FCALL                                               'cos'
         45        INIT_FCALL                                               'deg2rad'
         46        FETCH_DIM_R                                      ~40     !4, 'tom_geo_latitude'
         47        SEND_VAL                                                 ~40
         48        DO_ICALL                                         $41     
         49        SEND_VAR                                                 $41
         50        DO_ICALL                                         $42     
         51        MUL                                              ~43     $39, $42
         52        INIT_FCALL                                               'cos'
         53        INIT_FCALL                                               'deg2rad'
         54        FETCH_DIM_R                                      ~44     !4, 'tom_geo_longitude'
         55        SEND_VAL                                                 ~44
         56        DO_ICALL                                         $45     
         57        INIT_FCALL                                               'deg2rad'
         58        FETCH_DIM_R                                      ~46     !8, 1
         59        SEND_VAL                                                 ~46
         60        DO_ICALL                                         $47     
         61        SUB                                              ~48     $45, $47
         62        SEND_VAL                                                 ~48
         63        DO_ICALL                                         $49     
         64        MUL                                              ~50     $49, ~43
         65        INIT_FCALL                                               'sin'
         66        INIT_FCALL                                               'deg2rad'
         67        FETCH_DIM_R                                      ~51     !8, 0
         68        SEND_VAL                                                 ~51
         69        DO_ICALL                                         $52     
         70        SEND_VAR                                                 $52
         71        DO_ICALL                                         $53     
         72        INIT_FCALL                                               'sin'
         73        INIT_FCALL                                               'deg2rad'
         74        FETCH_DIM_R                                      ~54     !4, 'tom_geo_latitude'
         75        SEND_VAL                                                 ~54
         76        DO_ICALL                                         $55     
         77        SEND_VAR                                                 $55
         78        DO_ICALL                                         $56     
         79        MUL                                              ~57     $53, $56
         80        ADD                                              ~58     ~50, ~57
         81        SEND_VAL                                                 ~58
         82        DO_ICALL                                         $59     
         83        MUL                                              ~60     $59, 6371
         84        ASSIGN                                                   !7, ~60
   77    85        FETCH_DIM_R                                      ~62     !4, 'billing_firstname'
         86        CONCAT                                           ~63     ~62, '+'
         87        FETCH_DIM_R                                      ~64     !4, 'billing_lastname'
         88        CONCAT                                           ~65     ~63, ~64
         89        ASSIGN                                                   !9, ~65
   84    90        INIT_METHOD_CALL                                         !1, 'createElement'
         91        SEND_VAL_EX                                              'Marker'
         92        DO_FCALL                                      0  $67     
         93        ASSIGN                                                   !10, $67
   85    94        INIT_METHOD_CALL                                         !3, 'appendChild'
         95        SEND_VAR_EX                                              !10
         96        DO_FCALL                                      0  $69     
         97        ASSIGN                                                   !11, $69
   86    98        INIT_METHOD_CALL                                         !11, 'setAttribute'
         99        SEND_VAL_EX                                              'StoreId'
        100        CHECK_FUNC_ARG                                           
        101        FETCH_DIM_FUNC_ARG                               $71     !4, 'store_id'
        102        SEND_FUNC_ARG                                            $71
        103        DO_FCALL                                      0          
   87   104        INIT_METHOD_CALL                                         !11, 'setAttribute'
        105        SEND_VAL_EX                                              'Lat'
        106        CHECK_FUNC_ARG                                           
        107        FETCH_DIM_FUNC_ARG                               $73     !4, 'tom_geo_latitude'
        108        SEND_FUNC_ARG                                            $73
        109        DO_FCALL                                      0          
   88   110        INIT_METHOD_CALL                                         !11, 'setAttribute'
        111        SEND_VAL_EX                                              'Lng'
        112        CHECK_FUNC_ARG                                           
        113        FETCH_DIM_FUNC_ARG                               $75     !4, 'tom_geo_longitude'
        114        SEND_FUNC_ARG                                            $75
        115        DO_FCALL                                      0          
   89   116        INIT_METHOD_CALL                                         !11, 'setAttribute'
        117        SEND_VAL_EX                                              'Distance'
        118        SEND_VAR_EX                                              !7
        119        DO_FCALL                                      0          
   90   120        INIT_METHOD_CALL                                         !11, 'setAttribute'
        121        SEND_VAL_EX                                              'ImgUrl'
        122        CHECK_FUNC_ARG                                           
        123        FETCH_DIM_FUNC_ARG                               $78     !5, 'ImgUrl'
        124        SEND_FUNC_ARG                                            $78
        125        DO_FCALL                                      0          
   91   126        INIT_METHOD_CALL                                         !11, 'setAttribute'
        127        SEND_VAL_EX                                              'CategoryIcon'
        128        SEND_VAL_EX                                              '%2Fskin%2Ffrontend%2Fdefault%2Fsolarinvert%2Ftom%2Fdealer%2Fdefault.png'
        129        DO_FCALL                                      0          
   92   130        INIT_METHOD_CALL                                         !11, 'setAttribute'
        131        SEND_VAL_EX                                              'Contactperson'
        132        SEND_VAR_EX                                              !9
        133        DO_FCALL                                      0          
   93   134        INIT_METHOD_CALL                                         !11, 'setAttribute'
        135        SEND_VAL_EX                                              'Phone'
        136        CHECK_FUNC_ARG                                           
        137        FETCH_DIM_FUNC_ARG                               $82     !4, 'billing_telephone'
        138        SEND_FUNC_ARG                                            $82
        139        DO_FCALL                                      0          
   94   140        INIT_METHOD_CALL                                         !11, 'setAttribute'
        141        SEND_VAL_EX                                              'Logo'
        142        CHECK_FUNC_ARG                                           
        143        FETCH_DIM_FUNC_ARG                               $84     !4, 'logo'
        144        SEND_FUNC_ARG                                            $84
        145        DO_FCALL                                      0          
   73   146      > JMP                                                      ->23
        147    >   FE_FREE                                                  $23
  145   148        INIT_METHOD_CALL                                         !1, 'saveXML'
        149        DO_FCALL                                      0  $86     
        150        ECHO                                                     $86
        151      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.93 ms | 1413 KiB | 21 Q