3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(0=>"Premier: 3/svart/XL ID:35235", 1=>"Premier: 3/vit/S ID:9999", 2=>"Premier: 1 ID:333"); foreach ($a as $b) { $list_premier = explode('ID',$b); $premier = trim(substr($list_premier[0],10)); echo $premier . " => "; $premier = str_replace( array(' ', '1' , '2', '3'), array(' + ', 'tygvƤska', 'chocklad', 't-shirt'), $premier ) ; echo $premier . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 28
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 28
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/YV9CZ
function name:  (null)
number of ops:  30
compiled vars:  !0 = $a, !1 = $b, !2 = $list_premier, !3 = $premier
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $5      !0, ->28
          2    > > FE_FETCH_R                                               $5, !1, ->28
    6     3    >   INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 'ID'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
    7     8        INIT_FCALL                                               'trim'
          9        INIT_FCALL                                               'substr'
         10        FETCH_DIM_R                                      ~8      !2, 0
         11        SEND_VAL                                                 ~8
         12        SEND_VAL                                                 10
         13        DO_ICALL                                         $9      
         14        SEND_VAR                                                 $9
         15        DO_ICALL                                         $10     
         16        ASSIGN                                                   !3, $10
    8    17        CONCAT                                           ~12     !3, '+%3D%3E+'
         18        ECHO                                                     ~12
    9    19        INIT_FCALL                                               'str_replace'
         20        SEND_VAL                                                 <array>
         21        SEND_VAL                                                 <array>
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                         $13     
         24        ASSIGN                                                   !3, $13
   10    25        CONCAT                                           ~15     !3, '%0A'
         26        ECHO                                                     ~15
    5    27      > JMP                                                      ->2
         28    >   FE_FREE                                                  $5
   11    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.67 ms | 1396 KiB | 21 Q