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); echo implode( "<br>", array_map( function($logo, $url) { $html = sprintf('<img src="%s">', $logo); if ($url) { $html = sprintf('<a href="%s">%s</a>', $url, $html); } return $html; }, $jsonPartenaires['logo'], $jsonPartenaires['url_partenaire'] ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/52veN
function name:  (null)
number of ops:  19
compiled vars:  !0 = $jsonPartenaires
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        DO_ICALL                                         $1      
    3     4        ASSIGN                                                   !0, $1
   10     5        INIT_FCALL                                               'implode'
   11     6        SEND_VAL                                                 '%3Cbr%3E'
   12     7        INIT_FCALL                                               'array_map'
   13     8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F52veN%3A13%240'
   19     9        SEND_VAL                                                 ~3
   20    10        FETCH_DIM_R                                      ~4      !0, 'logo'
         11        SEND_VAL                                                 ~4
   21    12        FETCH_DIM_R                                      ~5      !0, 'url_partenaire'
         13        SEND_VAL                                                 ~5
         14        DO_ICALL                                         $6      
         15        SEND_VAR                                                 $6
         16        DO_ICALL                                         $7      
         17        ECHO                                                     $7
   23    18      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F52veN%3A13%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/52veN
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $logo, !1 = $url, !2 = $html
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        INIT_FCALL                                               'sprintf'
          3        SEND_VAL                                                 '%3Cimg+src%3D%22%25s%22%3E'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !2, $3
   15     7      > JMPZ                                                     !1, ->14
   16     8    >   INIT_FCALL                                               'sprintf'
          9        SEND_VAL                                                 '%3Ca+href%3D%22%25s%22%3E%25s%3C%2Fa%3E'
         10        SEND_VAR                                                 !1
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $5      
         13        ASSIGN                                                   !2, $5
   18    14    > > RETURN                                                   !2
   19    15*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F52veN%3A13%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.92 ms | 1400 KiB | 21 Q