3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fix ($value) { if (strpos($value, '\\') !== false) { if ($value[0] === '"') { $value = preg_replace('/[^\\\]\\\([^nrtvefxu0-7\$\\"])/', '\\\\$1', $value); } else { $value = preg_replace("/[^\\\]\\\([^'])/", '\\\\\1', $value); } } return substr($value, 1, -1); } echo fix('\'DATE \a\t TIME\''), "\n", fix('"FIELD\tFIELD"');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WqGos
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'fix'
          1        SEND_VAL                                                 '%27DATE+%5Ca%5Ct+TIME%27'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4        ECHO                                                     '%0A'
          5        INIT_FCALL                                               'fix'
          6        SEND_VAL                                                 '%22FIELD%5CtFIELD%22'
          7        DO_FCALL                                      0  $1      
          8        ECHO                                                     $1
          9      > RETURN                                                   1

Function fix:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 23
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/WqGos
function name:  fix
number of ops:  30
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%5C'
          4        DO_ICALL                                         $1      
          5        TYPE_CHECK                                  1018          $1
          6      > JMPZ                                                     ~2, ->23
    5     7    >   FETCH_DIM_R                                      ~3      !0, 0
          8        IS_IDENTICAL                                             ~3, '%22'
          9      > JMPZ                                                     ~4, ->17
    6    10    >   INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%2F%5B%5E%5C%5C%5D%5C%5C%28%5B%5Enrtvefxu0-7%5C%24%5C%22%5D%29%2F'
         12        SEND_VAL                                                 '%5C%5C%241'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $5      
         15        ASSIGN                                                   !0, $5
    5    16      > JMP                                                      ->23
    8    17    >   INIT_FCALL                                               'preg_replace'
         18        SEND_VAL                                                 '%2F%5B%5E%5C%5C%5D%5C%5C%28%5B%5E%27%5D%29%2F'
         19        SEND_VAL                                                 '%5C%5C%5C1'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $7      
         22        ASSIGN                                                   !0, $7
   12    23    >   INIT_FCALL                                               'substr'
         24        SEND_VAR                                                 !0
         25        SEND_VAL                                                 1
         26        SEND_VAL                                                 -1
         27        DO_ICALL                                         $9      
         28      > RETURN                                                   $9
   13    29*     > RETURN                                                   null

End of function fix

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.3 ms | 1015 KiB | 18 Q