3v4l.org

run code in 300+ PHP versions simultaneously
<?php $comma = "0,1,,,,,,,"; $str = "test"; //$comma = " " . $comma; $i=0; $pos=0; While($i != 3){ $pos = strpos($comma, ",", $pos+1); $i++; } Echo substr($comma,1,$pos) . $str . Substr($comma,$pos+1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 5
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 5
Branch analysis from position: 15
Branch analysis from position: 5
filename:       /in/LkfbL
function name:  (null)
number of ops:  29
compiled vars:  !0 = $comma, !1 = $str, !2 = $i, !3 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '0%2C1%2C%2C%2C%2C%2C%2C%2C'
    4     1        ASSIGN                                                   !1, 'test'
    7     2        ASSIGN                                                   !2, 0
    8     3        ASSIGN                                                   !3, 0
    9     4      > JMP                                                      ->13
   10     5    >   INIT_FCALL                                               'strpos'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 '%2C'
          8        ADD                                              ~8      !3, 1
          9        SEND_VAL                                                 ~8
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !3, $9
   11    12        PRE_INC                                                  !2
    9    13    >   IS_NOT_EQUAL                                             !2, 3
         14      > JMPNZ                                                    ~12, ->5
   14    15    >   INIT_FCALL                                               'substr'
         16        SEND_VAR                                                 !0
         17        SEND_VAL                                                 1
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                         $13     
         20        CONCAT                                           ~14     $13, !1
         21        INIT_FCALL                                               'substr'
         22        SEND_VAR                                                 !0
         23        ADD                                              ~15     !3, 1
         24        SEND_VAL                                                 ~15
         25        DO_ICALL                                         $16     
         26        CONCAT                                           ~17     ~14, $16
         27        ECHO                                                     ~17
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.38 ms | 1396 KiB | 17 Q