3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = json_decode('{ "key": "levels", "value": "[{role_id:1, access_level_id:3}, {role_id:2, access_level_id:1}, {role_id:3, access_level_id:2}]", "description": "" }', true); $x['value'] = json_decode(preg_replace('/(\w+)(?=:)/', '"$1"', $x['value']), true); print_r($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HgjJQ
function name:  (null)
number of ops:  21
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%0A%09%22key%22%3A+%22levels%22%2C%0A%09%22value%22%3A+%22%5B%7Brole_id%3A1%2C+access_level_id%3A3%7D%2C+%7Brole_id%3A2%2C+access_level_id%3A1%7D%2C+%7Brole_id%3A3%2C+access_level_id%3A2%7D%5D%22%2C%0A%09%22description%22%3A+%22%22%0A%7D'
    7     2        SEND_VAL                                                 <true>
    3     3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
    9     5        INIT_FCALL                                               'json_decode'
          6        INIT_FCALL                                               'preg_replace'
          7        SEND_VAL                                                 '%2F%28%5Cw%2B%29%28%3F%3D%3A%29%2F'
          8        SEND_VAL                                                 '%22%241%22'
          9        FETCH_DIM_R                                      ~4      !0, 'value'
         10        SEND_VAL                                                 ~4
         11        DO_ICALL                                         $5      
         12        SEND_VAR                                                 $5
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $6      
         15        ASSIGN_DIM                                               !0, 'value'
         16        OP_DATA                                                  $6
   10    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.27 ms | 1069 KiB | 16 Q