3v4l.org

run code in 300+ PHP versions simultaneously
<?php function expandShortUrl($shortUrl) { $ch = curl_init($shortUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $expandedUrl = curl_exec($ch); curl_close($ch); return $expandedUrl; } function expandShortUrls($shortUrls) { $expandedUrls = array(); foreach ($shortUrls as $shortUrl) { $expandedUrl = expandShortUrl($shortUrl); $expandedUrls[] = $expandedUrl; } return $expandedUrls; } // Kısa linkler $shortUrls = array( "https://www.etsy.com/listing/664135699", "https://www.etsy.com/listing/612721265", "https://www.etsy.com/listing/596197569", "https://www.etsy.com/listing/576635976", "https://www.etsy.com/listing/466790858", "https://www.etsy.com/listing/249127718", "https://www.etsy.com/listing/232208668", "https://www.etsy.com/listing/1741336387", "https://www.etsy.com/listing/1680069076", "https://www.etsy.com/listing/1659620413" ); // Kısa linkleri genişlet $expandedUrls = expandShortUrls($shortUrls); // Genişletilmiş linkleri yazdır foreach ($expandedUrls as $index => $expandedUrl) { echo ($index + 1) . ". " . $expandedUrl . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/mTS8v
function name:  (null)
number of ops:  16
compiled vars:  !0 = $shortUrls, !1 = $expandedUrls, !2 = $expandedUrl, !3 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   ASSIGN                                                   !0, <array>
   36     1        INIT_FCALL                                               'expandshorturls'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $5      
          4        ASSIGN                                                   !1, $5
   39     5      > FE_RESET_R                                       $7      !1, ->14
          6    > > FE_FETCH_R                                       ~8      $7, !2, ->14
          7    >   ASSIGN                                                   !3, ~8
   40     8        ADD                                              ~10     !3, 1
          9        CONCAT                                           ~11     ~10, '.+'
         10        CONCAT                                           ~12     ~11, !2
         11        CONCAT                                           ~13     ~12, '%0A'
         12        ECHO                                                     ~13
   39    13      > JMP                                                      ->6
         14    >   FE_FREE                                                  $7
   41    15      > RETURN                                                   1

Function expandshorturl:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mTS8v
function name:  expandShortUrl
number of ops:  26
compiled vars:  !0 = $shortUrl, !1 = $ch, !2 = $expandedUrl
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL_BY_NAME                                       'curl_init'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
    5     5        INIT_FCALL_BY_NAME                                       'curl_setopt'
          6        SEND_VAR_EX                                              !1
          7        FETCH_CONSTANT                                   ~5      'CURLOPT_RETURNTRANSFER'
          8        SEND_VAL_EX                                              ~5
          9        SEND_VAL_EX                                              <true>
         10        DO_FCALL                                      0          
    6    11        INIT_FCALL_BY_NAME                                       'curl_setopt'
         12        SEND_VAR_EX                                              !1
         13        FETCH_CONSTANT                                   ~7      'CURLOPT_FOLLOWLOCATION'
         14        SEND_VAL_EX                                              ~7
         15        SEND_VAL_EX                                              <true>
         16        DO_FCALL                                      0          
    7    17        INIT_FCALL_BY_NAME                                       'curl_exec'
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0  $9      
         20        ASSIGN                                                   !2, $9
    8    21        INIT_FCALL_BY_NAME                                       'curl_close'
         22        SEND_VAR_EX                                              !1
         23        DO_FCALL                                      0          
    9    24      > RETURN                                                   !2
   10    25*     > RETURN                                                   null

End of function expandshorturl

Function expandshorturls:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/mTS8v
function name:  expandShortUrls
number of ops:  14
compiled vars:  !0 = $shortUrls, !1 = $expandedUrls, !2 = $shortUrl, !3 = $expandedUrl
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ASSIGN                                                   !1, <array>
   14     2      > FE_RESET_R                                       $5      !0, ->11
          3    > > FE_FETCH_R                                               $5, !2, ->11
   15     4    >   INIT_FCALL                                               'expandshorturl'
          5        SEND_VAR                                                 !2
          6        DO_FCALL                                      0  $6      
          7        ASSIGN                                                   !3, $6
   16     8        ASSIGN_DIM                                               !1
          9        OP_DATA                                                  !3
   14    10      > JMP                                                      ->3
         11    >   FE_FREE                                                  $5
   18    12      > RETURN                                                   !1
   19    13*     > RETURN                                                   null

End of function expandshorturls

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.94 ms | 1438 KiB | 15 Q