3v4l.org

run code in 300+ 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}
number of ops:  13
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 '%2C'
          3        INIT_FCALL                                               'range'
          4        FETCH_DIM_R                                      ~1      !0, 1
          5        SEND_VAL                                                 ~1
          6        FETCH_DIM_R                                      ~2      !0, 2
          7        SEND_VAL                                                 ~2
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
         10        DO_ICALL                                         $4      
         11      > RETURN                                                   $4
    7    12*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.06 ms | 1010 KiB | 18 Q