3v4l.org

run code in 500+ PHP versions simultaneously
<?php $bom = "\xef\xbb\xbf"; $json_string = $bom.'{"greeting":"Hello world"}'; var_dump( $json_string, json_decode($json_string, true), preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $json_string), json_decode( preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $json_string), true ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MVh2P
function name:  (null)
number of ops:  22
compiled vars:  !0 = $bom, !1 = $json_string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%EF%BB%BF'
    3     1        CONCAT                                               ~3      !0, '%7B%22greeting%22%3A%22Hello+world%22%7D'
          2        ASSIGN                                                       !1, ~3
    4     3        INIT_FCALL                                                   'var_dump'
    5     4        SEND_VAR                                                     !1
    6     5        INIT_FCALL                                                   'json_decode'
          6        SEND_VAR                                                     !1
          7        SEND_VAL                                                     <true>
          8        DO_ICALL                                             $5      
          9        SEND_VAR                                                     $5
    7    10        FRAMELESS_ICALL_3                preg_replace        ~6      '%2F%5B%5Cx00-%5Cx1F%5Cx80-%5CxFF%5D%2F', ''
         11        OP_DATA                                                      !1
         12        SEND_VAL                                                     ~6
    8    13        INIT_FCALL                                                   'json_decode'
         14        FRAMELESS_ICALL_3                preg_replace        ~7      '%2F%5B%5Cx00-%5Cx1F%5Cx80-%5CxFF%5D%2F', ''
         15        OP_DATA                                                      !1
         16        SEND_VAL                                                     ~7
         17        SEND_VAL                                                     <true>
         18        DO_ICALL                                             $8      
         19        SEND_VAR                                                     $8
    4    20        DO_ICALL                                                     
    9    21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.44 ms | 1498 KiB | 15 Q