3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!defined('JSON_UNESCAPED_UNICODE')) { define('JSON_UNESCAPED_SLASHES', 64); define('JSON_UNESCAPED_UNICODE', 256); } $a = array('some' => 'test\\/'); var_dump($a); $j = json_encode($a, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); $j = str_replace('\/', '/', $j); var_dump($j);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 9
Branch analysis from position: 1
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/LvgoM
function name:  (null)
number of ops:  28
compiled vars:  !0 = $a, !1 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > JMPZ                                                     <false>, ->9
    4     1    >   INIT_FCALL                                               'define'
          2        SEND_VAL                                                 'JSON_UNESCAPED_SLASHES'
          3        SEND_VAL                                                 64
          4        DO_ICALL                                                 
    5     5        INIT_FCALL                                               'define'
          6        SEND_VAL                                                 'JSON_UNESCAPED_UNICODE'
          7        SEND_VAL                                                 256
          8        DO_ICALL                                                 
    8     9    >   ASSIGN                                                   !0, <array>
    9    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   10    13        INIT_FCALL                                               'json_encode'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 320
         16        DO_ICALL                                         $6      
         17        ASSIGN                                                   !1, $6
   12    18        INIT_FCALL                                               'str_replace'
         19        SEND_VAL                                                 '%5C%2F'
         20        SEND_VAL                                                 '%2F'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $8      
         23        ASSIGN                                                   !1, $8
   14    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.04 ms | 1400 KiB | 21 Q