3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1,1,1,2,2,3,3,4,1,1,2,2,3]; var_export( json_decode( preg_replace_callback( '/\b(\d+)(?:,\1)*\b/', function($m) { return sprintf( '{"%d":%d}', $m[1], count(explode(',', $m[0])) ); }, json_encode($array) ), true ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ESgbM
function name:  (null)
number of ops:  18
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'var_export'
    6     2        INIT_FCALL                                               'json_decode'
    7     3        INIT_FCALL                                               'preg_replace_callback'
    8     4        SEND_VAL                                                 '%2F%5Cb%28%5Cd%2B%29%28%3F%3A%2C%5C1%29%2A%5Cb%2F'
    9     5        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   15     6        SEND_VAL                                                 ~2
   16     7        INIT_FCALL                                               'json_encode'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $3      
         10        SEND_VAR                                                 $3
    7    11        DO_ICALL                                         $4      
   16    12        SEND_VAR                                                 $4
   18    13        SEND_VAL                                                 <true>
    6    14        DO_ICALL                                         $5      
   18    15        SEND_VAR                                                 $5
    5    16        DO_ICALL                                                 
   20    17      > 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/ESgbM
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'sprintf'
   11     2        SEND_VAL                                                 '%7B%22%25d%22%3A%25d%7D'
   12     3        FETCH_DIM_R                                      ~1      !0, 1
          4        SEND_VAL                                                 ~1
   13     5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%2C'
          7        FETCH_DIM_R                                      ~2      !0, 0
          8        SEND_VAL                                                 ~2
          9        DO_ICALL                                         $3      
         10        COUNT                                            ~4      $3
         11        SEND_VAL                                                 ~4
   10    12        DO_ICALL                                         $5      
   13    13      > RETURN                                                   $5
   15    14*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.24 ms | 1004 KiB | 19 Q