3v4l.org

run code in 300+ 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:  28
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        INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%2F%5B%5Cx00-%5Cx1F%5Cx80-%5CxFF%5D%2F'
         12        SEND_VAL                                                 ''
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $6      
         15        SEND_VAR                                                 $6
    8    16        INIT_FCALL                                               'json_decode'
         17        INIT_FCALL                                               'preg_replace'
         18        SEND_VAL                                                 '%2F%5B%5Cx00-%5Cx1F%5Cx80-%5CxFF%5D%2F'
         19        SEND_VAL                                                 ''
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $7      
         22        SEND_VAR                                                 $7
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $8      
         25        SEND_VAR                                                 $8
    4    26        DO_ICALL                                                 
    9    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.11 ms | 1002 KiB | 16 Q