3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = array('\s', '\n\t', "abc", 'abc\\\\foo'); foreach ($strings as $str) { $stripped = stripcslashes($str); $rebuilt = addcslashes($stripped, "\\\0\n\t\v\f\a\r\b"); var_dump($str, $str === $rebuilt, $rebuilt); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 19
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/TPenF
function name:  (null)
number of ops:  21
compiled vars:  !0 = $strings, !1 = $str, !2 = $stripped, !3 = $rebuilt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $5      !0, ->19
          2    > > FE_FETCH_R                                               $5, !1, ->19
    6     3    >   INIT_FCALL                                               'stripcslashes'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
    7     7        INIT_FCALL                                               'addcslashes'
          8        SEND_VAR                                                 !2
          9        SEND_VAL                                                 '%5C%00%0A%09%0B%0C%5Ca%0D%5Cb'
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !3, $8
    9    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        IS_IDENTICAL                                     ~10     !1, !3
         15        SEND_VAL                                                 ~10
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                                 
    5    18      > JMP                                                      ->2
         19    >   FE_FREE                                                  $5
   10    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.71 ms | 1395 KiB | 19 Q