3v4l.org

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

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.08 ms | 1010 KiB | 18 Q