3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sources = [ "{img:amp.jpg}", "{img:amp.jpg alt:something}", "{img:amp.jpg alt:something width:10 height:11}", ]; foreach ($sources as $str) { $str = str_replace(['{', '}', ':', 'img'], ['', '', '="', 'src'], $str); echo sprintf( '<img %s>', implode(" ", array_map(function($a){return $a . '"';}, explode(' ', $str))) ) . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 29
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 29
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/BCLNX
function name:  (null)
number of ops:  31
compiled vars:  !0 = $sources, !1 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1      > FE_RESET_R                                       $3      !0, ->29
          2    > > FE_FETCH_R                                               $3, !1, ->29
   10     3    >   INIT_FCALL                                               'str_replace'
          4        SEND_VAL                                                 <array>
          5        SEND_VAL                                                 <array>
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !1, $4
   11     9        INIT_FCALL                                               'sprintf'
   12    10        SEND_VAL                                                 '%3Cimg+%25s%3E'
   13    11        INIT_FCALL                                               'implode'
         12        SEND_VAL                                                 '+'
         13        INIT_FCALL                                               'array_map'
         14        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
         15        SEND_VAL                                                 ~6
         16        INIT_FCALL                                               'explode'
         17        SEND_VAL                                                 '+'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $7      
         20        SEND_VAR                                                 $7
         21        DO_ICALL                                         $8      
         22        SEND_VAR                                                 $8
         23        DO_ICALL                                         $9      
         24        SEND_VAR                                                 $9
   11    25        DO_ICALL                                         $10     
   14    26        CONCAT                                           ~11     $10, '%0A'
         27        ECHO                                                     ~11
    9    28      > JMP                                                      ->2
         29    >   FE_FREE                                                  $3
   15    30      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BCLNX
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        CONCAT                                           ~1      !0, '%22'
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.49 ms | 1073 KiB | 18 Q