3v4l.org

run code in 300+ PHP versions simultaneously
<?php $responses = array('tok1' => '<Order> <OrderID>112</OrderID> </Order>', 'tok2' => '<Order> <OrderID>390</OrderID> </Order>', 'tok3' => '<Order> <OrderID>162</OrderID> </Order>', 'tok4' => '<Order> <OrderID>372</OrderID> </Order>'); $auth_tokens = array('tok1', 'tok2', 'tok3', 'tok4'); $xmlstr = ''; foreach($auth_tokens as $auth_token) { // 4 iterations in loop $response = $responses($auth_token); // API xml response $xmlstr .= $response; // add response to XML } $xml = simplexml_load_string("<Orders>$xmlstr</Orders>"); header('content-type: text/xml'); echo $xml->asXML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/bFMiV
function name:  (null)
number of ops:  26
compiled vars:  !0 = $responses, !1 = $auth_tokens, !2 = $xmlstr, !3 = $auth_token, !4 = $response, !5 = $xml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   14     1        ASSIGN                                                   !1, <array>
   15     2        ASSIGN                                                   !2, ''
   16     3      > FE_RESET_R                                       $9      !1, ->11
          4    > > FE_FETCH_R                                               $9, !3, ->11
   17     5    >   INIT_DYNAMIC_CALL                                        !0
          6        SEND_VAR_EX                                              !3
          7        DO_FCALL                                      0  $10     
          8        ASSIGN                                                   !4, $10
   18     9        ASSIGN_OP                                     8          !2, !4
   16    10      > JMP                                                      ->4
         11    >   FE_FREE                                                  $9
   20    12        INIT_FCALL                                               'simplexml_load_string'
         13        ROPE_INIT                                     3  ~14     '%3COrders%3E'
         14        ROPE_ADD                                      1  ~14     ~14, !2
         15        ROPE_END                                      2  ~13     ~14, '%3C%2FOrders%3E'
         16        SEND_VAL                                                 ~13
         17        DO_ICALL                                         $16     
         18        ASSIGN                                                   !5, $16
   21    19        INIT_FCALL                                               'header'
         20        SEND_VAL                                                 'content-type%3A+text%2Fxml'
         21        DO_ICALL                                                 
   22    22        INIT_METHOD_CALL                                         !5, 'asXML'
         23        DO_FCALL                                      0  $19     
         24        ECHO                                                     $19
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.21 ms | 1395 KiB | 17 Q