3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dd($string) { return preg_replace('/([~]+)\[/e','str_repeat("~",strlen("$1")*2)."[";', $string); } print dd("a-b\n"); print dd("a~b\n"); print dd("a[b\n"); print dd("a~[b\n"); print dd("a~~[b\n");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n1onJ
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'dd'
          1        SEND_VAL                                                 'a-b%0A'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
    9     4        INIT_FCALL                                               'dd'
          5        SEND_VAL                                                 'a%7Eb%0A'
          6        DO_FCALL                                      0  $1      
          7        ECHO                                                     $1
   10     8        INIT_FCALL                                               'dd'
          9        SEND_VAL                                                 'a%5Bb%0A'
         10        DO_FCALL                                      0  $2      
         11        ECHO                                                     $2
   11    12        INIT_FCALL                                               'dd'
         13        SEND_VAL                                                 'a%7E%5Bb%0A'
         14        DO_FCALL                                      0  $3      
         15        ECHO                                                     $3
   12    16        INIT_FCALL                                               'dd'
         17        SEND_VAL                                                 'a%7E%7E%5Bb%0A'
         18        DO_FCALL                                      0  $4      
         19        ECHO                                                     $4
         20      > RETURN                                                   1

Function dd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n1onJ
function name:  dd
number of ops:  8
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%5B%7E%5D%2B%29%5C%5B%2Fe'
          3        SEND_VAL                                                 'str_repeat%28%22%7E%22%2Cstrlen%28%22%241%22%29%2A2%29.%22%5B%22%3B'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
    6     7*     > RETURN                                                   null

End of function dd

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.15 ms | 1398 KiB | 20 Q