3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '[{2:,0:1,1:Rodapi\u00e9s 1-a, 2-a, bloque 6}, {4:x, y, z,0 :111, 3:some random text},{5:a45:bc,def}]'; $str = preg_replace('/(?<=[{,])\s*(\d+)\s*:(.*?)(?=}|,\s*\d+\s*:)/', '"$1":"$2"', $str); $obj = json_decode($str); print_r($obj);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gsOc6
function name:  (null)
number of ops:  15
compiled vars:  !0 = $str, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5B%7B2%3A%2C0%3A1%2C1%3ARodapi%5Cu00e9s+1-a%2C+2-a%2C+bloque+6%7D%2C%0A%7B4%3Ax%2C+y%2C+z%2C0+%3A111%2C+3%3Asome+random+text%7D%2C%7B5%3Aa45%3Abc%2Cdef%7D%5D'
    6     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%3F%3C%3D%5B%7B%2C%5D%29%5Cs%2A%28%5Cd%2B%29%5Cs%2A%3A%28.%2A%3F%29%28%3F%3D%7D%7C%2C%5Cs%2A%5Cd%2B%5Cs%2A%3A%29%2F'
          3        SEND_VAL                                                 '%22%241%22%3A%22%242%22'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
    8     7        INIT_FCALL                                               'json_decode'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !1, $5
    9    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.1 ms | 1011 KiB | 16 Q