3v4l.org

run code in 300+ PHP versions simultaneously
<?php $urls = array('www.roi.ru/api/petition/309.json', 'www.roi.ru/api/petition/401.json'); $urls2 = array('api.vkontakte.ru/method/users.get?uids=1', 'api.vkontakte.ru/method/users.get?uids=2'); $cmh = curl_multi_init(); $tasks = array(); foreach ($urls2 as $url) { $ch = curl_init('https://'.$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $tasks[$url] = $ch; curl_multi_add_handle($cmh, $ch); } $active = null; do { $mrc = curl_multi_exec($cmh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); while ($active && ($mrc == CURLM_OK)) { if (curl_multi_select($cmh) != -1) { do { $mrc = curl_multi_exec($cmh, $active); $info = curl_multi_info_read($cmh); if ($info['msg'] == CURLMSG_DONE) { $ch = $info['handle']; $url = array_search($ch, $tasks); $tasks[$url] = curl_multi_getcontent($ch); curl_multi_remove_handle($cmh, $ch); curl_close($ch); } } while ($mrc == CURLM_CALL_MULTI_PERFORM); } } curl_multi_close($cmh); echo "<br><pre>"; var_dump($tasks); echo "</pre>"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 56
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 56
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 66, Position 2 = 58
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 107
Branch analysis from position: 107
2 jumps found. (Code = 46) Position 1 = 108, Position 2 = 111
Branch analysis from position: 108
2 jumps found. (Code = 44) Position 1 = 112, Position 2 = 67
Branch analysis from position: 112
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 67
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 107
Branch analysis from position: 72
2 jumps found. (Code = 43) Position 1 = 85, Position 2 = 104
Branch analysis from position: 85
2 jumps found. (Code = 44) Position 1 = 107, Position 2 = 72
Branch analysis from position: 107
Branch analysis from position: 72
Branch analysis from position: 104
Branch analysis from position: 107
Branch analysis from position: 111
Branch analysis from position: 58
Branch analysis from position: 56
filename:       /in/spkev
function name:  (null)
number of ops:  121
compiled vars:  !0 = $urls, !1 = $urls2, !2 = $cmh, !3 = $tasks, !4 = $url, !5 = $ch, !6 = $active, !7 = $mrc, !8 = $info
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL_BY_NAME                                       'curl_multi_init'
          3        DO_FCALL                                      0  $11     
          4        ASSIGN                                                   !2, $11
    6     5        ASSIGN                                                   !3, <array>
    7     6      > FE_RESET_R                                       $14     !1, ->56
          7    > > FE_FETCH_R                                               $14, !4, ->56
    8     8    >   INIT_FCALL_BY_NAME                                       'curl_init'
          9        CONCAT                                           ~15     'https%3A%2F%2F', !4
         10        SEND_VAL_EX                                              ~15
         11        DO_FCALL                                      0  $16     
         12        ASSIGN                                                   !5, $16
    9    13        INIT_FCALL_BY_NAME                                       'curl_setopt'
         14        SEND_VAR_EX                                              !5
         15        FETCH_CONSTANT                                   ~18     'CURLOPT_RETURNTRANSFER'
         16        SEND_VAL_EX                                              ~18
         17        SEND_VAL_EX                                              1
         18        DO_FCALL                                      0          
   10    19        INIT_FCALL_BY_NAME                                       'curl_setopt'
         20        SEND_VAR_EX                                              !5
         21        FETCH_CONSTANT                                   ~20     'CURLOPT_HEADER'
         22        SEND_VAL_EX                                              ~20
         23        SEND_VAL_EX                                              0
         24        DO_FCALL                                      0          
   11    25        INIT_FCALL_BY_NAME                                       'curl_setopt'
         26        SEND_VAR_EX                                              !5
         27        FETCH_CONSTANT                                   ~22     'CURLOPT_CONNECTTIMEOUT'
         28        SEND_VAL_EX                                              ~22
         29        SEND_VAL_EX                                              10
         30        DO_FCALL                                      0          
   12    31        INIT_FCALL_BY_NAME                                       'curl_setopt'
         32        SEND_VAR_EX                                              !5
         33        FETCH_CONSTANT                                   ~24     'CURLOPT_TIMEOUT'
         34        SEND_VAL_EX                                              ~24
         35        SEND_VAL_EX                                              10
         36        DO_FCALL                                      0          
   13    37        INIT_FCALL_BY_NAME                                       'curl_setopt'
         38        SEND_VAR_EX                                              !5
         39        FETCH_CONSTANT                                   ~26     'CURLOPT_SSL_VERIFYHOST'
         40        SEND_VAL_EX                                              ~26
         41        SEND_VAL_EX                                              0
         42        DO_FCALL                                      0          
   14    43        INIT_FCALL_BY_NAME                                       'curl_setopt'
         44        SEND_VAR_EX                                              !5
         45        FETCH_CONSTANT                                   ~28     'CURLOPT_SSL_VERIFYPEER'
         46        SEND_VAL_EX                                              ~28
         47        SEND_VAL_EX                                              0
         48        DO_FCALL                                      0          
   15    49        ASSIGN_DIM                                               !3, !4
         50        OP_DATA                                                  !5
   16    51        INIT_FCALL_BY_NAME                                       'curl_multi_add_handle'
         52        SEND_VAR_EX                                              !2
         53        SEND_VAR_EX                                              !5
         54        DO_FCALL                                      0          
    7    55      > JMP                                                      ->7
         56    >   FE_FREE                                                  $14
   19    57        ASSIGN                                                   !6, null
   21    58    >   INIT_FCALL_BY_NAME                                       'curl_multi_exec'
         59        SEND_VAR_EX                                              !2
         60        SEND_VAR_EX                                              !6
         61        DO_FCALL                                      0  $33     
         62        ASSIGN                                                   !7, $33
   23    63        FETCH_CONSTANT                                   ~35     'CURLM_CALL_MULTI_PERFORM'
         64        IS_EQUAL                                                 !7, ~35
         65      > JMPNZ                                                    ~36, ->58
   25    66    > > JMP                                                      ->107
   26    67    >   INIT_FCALL_BY_NAME                                       'curl_multi_select'
         68        SEND_VAR_EX                                              !2
         69        DO_FCALL                                      0  $37     
         70        IS_NOT_EQUAL                                             $37, -1
         71      > JMPZ                                                     ~38, ->107
   28    72    >   INIT_FCALL_BY_NAME                                       'curl_multi_exec'
         73        SEND_VAR_EX                                              !2
         74        SEND_VAR_EX                                              !6
         75        DO_FCALL                                      0  $39     
         76        ASSIGN                                                   !7, $39
   29    77        INIT_FCALL_BY_NAME                                       'curl_multi_info_read'
         78        SEND_VAR_EX                                              !2
         79        DO_FCALL                                      0  $41     
         80        ASSIGN                                                   !8, $41
   30    81        FETCH_DIM_R                                      ~43     !8, 'msg'
         82        FETCH_CONSTANT                                   ~44     'CURLMSG_DONE'
         83        IS_EQUAL                                                 ~43, ~44
         84      > JMPZ                                                     ~45, ->104
   31    85    >   FETCH_DIM_R                                      ~46     !8, 'handle'
         86        ASSIGN                                                   !5, ~46
   32    87        INIT_FCALL                                               'array_search'
         88        SEND_VAR                                                 !5
         89        SEND_VAR                                                 !3
         90        DO_ICALL                                         $48     
         91        ASSIGN                                                   !4, $48
   33    92        INIT_FCALL_BY_NAME                                       'curl_multi_getcontent'
         93        SEND_VAR_EX                                              !5
         94        DO_FCALL                                      0  $51     
         95        ASSIGN_DIM                                               !3, !4
         96        OP_DATA                                                  $51
   34    97        INIT_FCALL_BY_NAME                                       'curl_multi_remove_handle'
         98        SEND_VAR_EX                                              !2
         99        SEND_VAR_EX                                              !5
        100        DO_FCALL                                      0          
   35   101        INIT_FCALL_BY_NAME                                       'curl_close'
        102        SEND_VAR_EX                                              !5
        103        DO_FCALL                                      0          
   38   104    >   FETCH_CONSTANT                                   ~54     'CURLM_CALL_MULTI_PERFORM'
        105        IS_EQUAL                                                 !7, ~54
        106      > JMPNZ                                                    ~55, ->72
   25   107    > > JMPZ_EX                                          ~56     !6, ->111
        108    >   FETCH_CONSTANT                                   ~57     'CURLM_OK'
        109        IS_EQUAL                                         ~58     !7, ~57
        110        BOOL                                             ~56     ~58
        111    > > JMPNZ                                                    ~56, ->67
   43   112    >   INIT_FCALL_BY_NAME                                       'curl_multi_close'
        113        SEND_VAR_EX                                              !2
        114        DO_FCALL                                      0          
   44   115        ECHO                                                     '%3Cbr%3E%3Cpre%3E'
   45   116        INIT_FCALL                                               'var_dump'
        117        SEND_VAR                                                 !3
        118        DO_ICALL                                                 
   46   119        ECHO                                                     '%3C%2Fpre%3E'
   48   120      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
189.09 ms | 1469 KiB | 15 Q