3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo preg_replace_callback('/\d+/', function($match){ $match[0] = intval($match[0]); if ($match[0]<100) { return sprintf("%'.03d", $match[0]); } else { return $match[1]; } }, 'H_000100');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JEMVV
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'preg_replace_callback'
          1        SEND_VAL                                                 '%2F%5Cd%2B%2F'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJEMVV%3A3%240'
   10     3        SEND_VAL                                                 ~0
          4        SEND_VAL                                                 'H_000100'
          5        DO_ICALL                                         $1      
          6        ECHO                                                     $1
          7      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FJEMVV%3A3%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JEMVV
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_DIM_R                                      ~2      !0, 0
          2        CAST                                          4  ~3      ~2
          3        ASSIGN_DIM                                               !0, 0
          4        OP_DATA                                                  ~3
    5     5        FETCH_DIM_R                                      ~4      !0, 0
          6        IS_SMALLER                                               ~4, 100
          7      > JMPZ                                                     ~5, ->15
    6     8    >   INIT_FCALL                                               'sprintf'
          9        SEND_VAL                                                 '%25%27.03d'
         10        FETCH_DIM_R                                      ~6      !0, 0
         11        SEND_VAL                                                 ~6
         12        DO_ICALL                                         $7      
         13      > RETURN                                                   $7
         14*       JMP                                                      ->17
    8    15    >   FETCH_DIM_R                                      ~8      !0, 1
         16      > RETURN                                                   ~8
   10    17*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FJEMVV%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163 ms | 1396 KiB | 17 Q