3v4l.org

run code in 500+ 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:/in/ESgbM:9}
number of ops:  17
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
   12     1        FETCH_DIM_R                                          ~1      !0, 1
   13     2        INIT_FCALL                                                   'explode'
          3        SEND_VAL                                                     '%2C'
          4        FETCH_DIM_R                                          ~2      !0, 0
          5        SEND_VAL                                                     ~2
          6        DO_ICALL                                             $3      
          7        COUNT                                                ~4      $3
          8        ROPE_INIT                                         5  ~8      '%7B%22'
          9        CAST                                              4  ~5      ~1
         10        ROPE_ADD                                          1  ~8      ~8, ~5
         11        ROPE_ADD                                          2  ~8      ~8, '%22%3A'
         12        CAST                                              4  ~6      ~4
         13        ROPE_ADD                                          3  ~8      ~8, ~6
         14        ROPE_END                                          4  ~7      ~8, '%7D'
         15      > RETURN                                                       ~7
   15    16*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
222.79 ms | 2049 KiB | 18 Q