3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = <<<DATA {"foo": 1, "bar": "hello"} {"foo": 2, "bar": "cruel"} {"foo": 3, "bar": "world"} [1,2,3,4] DATA; $output = '[' . preg_replace('/([\]}])\s*([{[])/', '$1,$2', $input) . ']'; echo $output;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9gj92
function name:  (null)
number of ops:  11
compiled vars:  !0 = $input, !1 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%22foo%22%3A+1%2C+%22bar%22%3A+%22hello%22%7D%0A%7B%22foo%22%3A+2%2C+%22bar%22%3A+%22cruel%22%7D%0A%7B%22foo%22%3A+3%2C+%22bar%22%3A+%22world%22%7D%0A%5B1%2C2%2C3%2C4%5D'
   10     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%5B%5C%5D%7D%5D%29%5Cs%2A%28%5B%7B%5B%5D%29%2F'
          3        SEND_VAL                                                 '%241%2C%242'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        CONCAT                                           ~4      '%5B', $3
          7        CONCAT                                           ~5      ~4, '%5D'
          8        ASSIGN                                                   !1, ~5
   12     9        ECHO                                                     !1
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.8 ms | 1394 KiB | 15 Q