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); } $original = 'test/'; // what master does // CompatibilityHelper->escapeTerm $master = str_replace('/', '\\' . '/', $original); $master_a = array('query' => $master); $omp917 = str_replace('/', '\\\\' . '/', $original); // Elastica/Transport/Http $master_j = json_encode($master_a, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); $master_j = str_replace('\/', '/', $master_j); $omp917_j = json_encode($master_a, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); $omp917_j = str_replace('\/', '/', $master_j); var_dump($master_j); var_dump($omp917_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/NlqlO
function name:  (null)
number of ops:  53
compiled vars:  !0 = $original, !1 = $master, !2 = $master_a, !3 = $omp917, !4 = $master_j, !5 = $omp917_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, 'test%2F'
   12    10        INIT_FCALL                                               'str_replace'
         11        SEND_VAL                                                 '%2F'
         12        SEND_VAL                                                 '%5C%2F'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !1, $9
   13    16        INIT_ARRAY                                       ~11     !1, 'query'
         17        ASSIGN                                                   !2, ~11
   15    18        INIT_FCALL                                               'str_replace'
         19        SEND_VAL                                                 '%2F'
         20        SEND_VAL                                                 '%5C%5C%2F'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $13     
         23        ASSIGN                                                   !3, $13
   18    24        INIT_FCALL                                               'json_encode'
         25        SEND_VAR                                                 !2
         26        SEND_VAL                                                 320
         27        DO_ICALL                                         $15     
         28        ASSIGN                                                   !4, $15
   19    29        INIT_FCALL                                               'str_replace'
         30        SEND_VAL                                                 '%5C%2F'
         31        SEND_VAL                                                 '%2F'
         32        SEND_VAR                                                 !4
         33        DO_ICALL                                         $17     
         34        ASSIGN                                                   !4, $17
   21    35        INIT_FCALL                                               'json_encode'
         36        SEND_VAR                                                 !2
         37        SEND_VAL                                                 320
         38        DO_ICALL                                         $19     
         39        ASSIGN                                                   !5, $19
   22    40        INIT_FCALL                                               'str_replace'
         41        SEND_VAL                                                 '%5C%2F'
         42        SEND_VAL                                                 '%2F'
         43        SEND_VAR                                                 !4
         44        DO_ICALL                                         $21     
         45        ASSIGN                                                   !5, $21
   24    46        INIT_FCALL                                               'var_dump'
         47        SEND_VAR                                                 !4
         48        DO_ICALL                                                 
   25    49        INIT_FCALL                                               'var_dump'
         50        SEND_VAR                                                 !5
         51        DO_ICALL                                                 
         52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.81 ms | 1400 KiB | 21 Q