3v4l.org

run code in 300+ PHP versions simultaneously
<?php $jsonPartenaires = json_decode('{ "logo": ["images/website_logo_1.png","images/website_logo_2.png","images/website_logo_3.png"], "url_partenaire": ["","https://www.url_website_2.fr",""] }', true); foreach ($jsonPartenaires['logo'] as $i => $logo) { $html = sprintf('<img src="%s">', $logo); if ($jsonPartenaires['url_partenaire'][$i]) { $html = sprintf( '<a href="%s">%s</a>', $jsonPartenaires['url_partenaire'][$i], $html ); } echo $html . "<br>"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 28
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 28
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 25
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 25
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/o2q6v
function name:  (null)
number of ops:  30
compiled vars:  !0 = $jsonPartenaires, !1 = $logo, !2 = $i, !3 = $html
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%0A%22logo%22%3A+%0A%5B%22images%2Fwebsite_logo_1.png%22%2C%22images%2Fwebsite_logo_2.png%22%2C%22images%2Fwebsite_logo_3.png%22%5D%2C%0A%22url_partenaire%22%3A+%0A%5B%22%22%2C%22https%3A%2F%2Fwww.url_website_2.fr%22%2C%22%22%5D%0A%7D'
    8     2        SEND_VAL                                                 <true>
    3     3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !0, $4
   10     5        FETCH_DIM_R                                      ~6      !0, 'logo'
          6      > FE_RESET_R                                       $7      ~6, ->28
          7    > > FE_FETCH_R                                       ~8      $7, !1, ->28
          8    >   ASSIGN                                                   !2, ~8
   11     9        INIT_FCALL                                               'sprintf'
         10        SEND_VAL                                                 '%3Cimg+src%3D%22%25s%22%3E'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !3, $10
   12    14        FETCH_DIM_R                                      ~12     !0, 'url_partenaire'
         15        FETCH_DIM_R                                      ~13     ~12, !2
         16      > JMPZ                                                     ~13, ->25
   13    17    >   INIT_FCALL                                               'sprintf'
   14    18        SEND_VAL                                                 '%3Ca+href%3D%22%25s%22%3E%25s%3C%2Fa%3E'
   15    19        FETCH_DIM_R                                      ~14     !0, 'url_partenaire'
         20        FETCH_DIM_R                                      ~15     ~14, !2
         21        SEND_VAL                                                 ~15
   16    22        SEND_VAR                                                 !3
   13    23        DO_ICALL                                         $16     
         24        ASSIGN                                                   !3, $16
   19    25    >   CONCAT                                           ~18     !3, '%3Cbr%3E'
         26        ECHO                                                     ~18
   10    27      > JMP                                                      ->7
         28    >   FE_FREE                                                  $7
   20    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.58 ms | 1012 KiB | 15 Q