3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str1 = "AWK-JES-0001"; $parts = explode("AWK-JES-",$str1); echo sprintf($parts[0] . '-%04d', $parts[1]+1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JCfdR
function name:  (null)
number of ops:  16
compiled vars:  !0 = $str1, !1 = $parts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'AWK-JES-0001'
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 'AWK-JES-'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    6     6        INIT_FCALL                                               'sprintf'
          7        FETCH_DIM_R                                      ~5      !1, 0
          8        CONCAT                                           ~6      ~5, '-%2504d'
          9        SEND_VAL                                                 ~6
         10        FETCH_DIM_R                                      ~7      !1, 1
         11        ADD                                              ~8      ~7, 1
         12        SEND_VAL                                                 ~8
         13        DO_ICALL                                         $9      
         14        ECHO                                                     $9
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.3 ms | 1385 KiB | 17 Q