3v4l.org

run code in 500+ PHP versions simultaneously
<?php $json = '{"test" : "test one \xe0, \x270B"}'; echo var_export(json_validate($json), true); $json = preg_replace_callback( pattern: '/\\\\x([[:xdigit:]]+)/', callback: fn($m) => sprintf('\u%04s', $m[1]), subject: $json, count: $count ); echo "\n$count"; echo "\n" . var_export(json_validate($json), true); echo "\n$json\n"; var_export(json_decode($json));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gbRIs
function name:  (null)
number of ops:  41
compiled vars:  !0 = $json, !1 = $count
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%7B%22test%22+%3A+%22test+one+%5Cxe0%2C+%5Cx270B%22%7D'
    5     1        INIT_FCALL                                                   'var_export'
          2        INIT_FCALL                                                   'json_validate'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $3      
          5        SEND_VAR                                                     $3
          6        SEND_VAL                                                     <true>
          7        DO_ICALL                                             $4      
          8        ECHO                                                         $4
    7     9        INIT_FCALL                                                   'preg_replace_callback'
    8    10        SEND_VAL                                                     '%2F%5C%5Cx%28%5B%5B%3Axdigit%3A%5D%5D%2B%29%2F'
    9    11        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
         12        SEND_VAL                                                     ~5
   10    13        SEND_VAR                                                     !0
   11    14        SEND_REF                                                     !1, 'count'
         15        CHECK_UNDEF_ARGS                                             
    7    16        DO_ICALL                                             $6      
         17        ASSIGN                                                       !0, $6
   14    18        NOP                                                          
         19        FAST_CONCAT                                          ~8      '%0A', !1
         20        ECHO                                                         ~8
   15    21        INIT_FCALL                                                   'var_export'
         22        INIT_FCALL                                                   'json_validate'
         23        SEND_VAR                                                     !0
         24        DO_ICALL                                             $9      
         25        SEND_VAR                                                     $9
         26        SEND_VAL                                                     <true>
         27        DO_ICALL                                             $10     
         28        CONCAT                                               ~11     '%0A', $10
         29        ECHO                                                         ~11
   16    30        ROPE_INIT                                         3  ~13     '%0A'
         31        ROPE_ADD                                          1  ~13     ~13, !0
         32        ROPE_END                                          2  ~12     ~13, '%0A'
         33        ECHO                                                         ~12
   17    34        INIT_FCALL                                                   'var_export'
         35        INIT_FCALL                                                   'json_decode'
         36        SEND_VAR                                                     !0
         37        DO_ICALL                                             $15     
         38        SEND_VAR                                                     $15
         39        DO_ICALL                                                     
         40      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gbRIs
function name:  {closure:/in/gbRIs:9}
number of ops:  8
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'sprintf'
          2        SEND_VAL                                                     '%5Cu%2504s'
          3        FETCH_DIM_R                                          ~1      !0, 1
          4        SEND_VAL                                                     ~1
          5        DO_ICALL                                             $2      
          6      > RETURN                                                       $2
          7*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.84 ms | 1620 KiB | 18 Q