3v4l.org

run code in 500+ PHP versions simultaneously
<?php $input = '3,5,6,9,11,23,14-42'; $result = json_decode('['. preg_replace_callback('/(\d+)-(\d+)/', function($m) { return implode(',', range($m[1], $m[2])); }, $input) .']'); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dMlFp
function name:  (null)
number of ops:  17
compiled vars:  !0 = $input, !1 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '3%2C5%2C6%2C9%2C11%2C23%2C14-42'
    5     1        INIT_FCALL                                                   'json_decode'
          2        INIT_FCALL                                                   'preg_replace_callback'
          3        SEND_VAL                                                     '%2F%28%5Cd%2B%29-%28%5Cd%2B%29%2F'
          4        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
    7     5        SEND_VAL                                                     ~3
          6        SEND_VAR                                                     !0
    5     7        DO_ICALL                                             $4      
    7     8        CONCAT                                               ~5      '%5B', $4
          9        CONCAT                                               ~6      ~5, '%5D'
         10        SEND_VAL                                                     ~6
    5    11        DO_ICALL                                             $7      
         12        ASSIGN                                                       !1, $7
    9    13        INIT_FCALL                                                   'var_dump'
         14        SEND_VAR                                                     !1
         15        DO_ICALL                                                     
         16      > 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/dMlFp
function name:  {closure:/in/dMlFp:5}
number of ops:  10
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    6     1        INIT_FCALL                                                   'range'
          2        FETCH_DIM_R                                          ~1      !0, 1
          3        SEND_VAL                                                     ~1
          4        FETCH_DIM_R                                          ~2      !0, 2
          5        SEND_VAL                                                     ~2
          6        DO_ICALL                                             $3      
          7        FRAMELESS_ICALL_2                implode             ~4      '%2C', $3
          8      > RETURN                                                       ~4
    7     9*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
238.69 ms | 3689 KiB | 17 Q