3v4l.org

run code in 500+ PHP versions simultaneously
<?php $input_zwsp_utf8 = "\xE2\x80\x8B"; echo "Binary mode: match three bytes\n-----\n"; echo "in: $input_zwsp_utf8--\nhex: ".bin2hex($input_zwsp_utf8)."\n"; $output = preg_replace('/\xE2\x80\x8B/', '', $input_zwsp_utf8); echo "out: $output--\nhex: ".bin2hex($output)."\n\n"; echo "UTF-8 mode: match a Unicode code point\n-----\n"; echo "in: $input_zwsp_utf8--\nhex: ".bin2hex($input_zwsp_utf8)."\n"; $output = preg_replace('/\x{200B}/u', '', $input_zwsp_utf8); echo "out: $output--\nhex: ".bin2hex($output)."\n\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T91KQ
function name:  (null)
number of ops:  46
compiled vars:  !0 = $input_zwsp_utf8, !1 = $output
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%E2%80%8B'
    5     1        ECHO                                                         'Binary+mode%3A+match+three+bytes%0A-----%0A'
    6     2        ROPE_INIT                                         3  ~4      'in%3A+'
          3        ROPE_ADD                                          1  ~4      ~4, !0
          4        ROPE_END                                          2  ~3      ~4, '--%0Ahex%3A+'
          5        INIT_FCALL                                                   'bin2hex'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                             $6      
          8        CONCAT                                               ~7      ~3, $6
          9        CONCAT                                               ~8      ~7, '%0A'
         10        ECHO                                                         ~8
    7    11        FRAMELESS_ICALL_3                preg_replace        ~9      '%2F%5CxE2%5Cx80%5Cx8B%2F', ''
         12        OP_DATA                                                      !0
         13        ASSIGN                                                       !1, ~9
    8    14        ROPE_INIT                                         3  ~12     'out%3A+'
         15        ROPE_ADD                                          1  ~12     ~12, !1
         16        ROPE_END                                          2  ~11     ~12, '--%0Ahex%3A+'
         17        INIT_FCALL                                                   'bin2hex'
         18        SEND_VAR                                                     !1
         19        DO_ICALL                                             $14     
         20        CONCAT                                               ~15     ~11, $14
         21        CONCAT                                               ~16     ~15, '%0A%0A'
         22        ECHO                                                         ~16
   10    23        ECHO                                                         'UTF-8+mode%3A+match+a+Unicode+code+point%0A-----%0A'
   11    24        ROPE_INIT                                         3  ~18     'in%3A+'
         25        ROPE_ADD                                          1  ~18     ~18, !0
         26        ROPE_END                                          2  ~17     ~18, '--%0Ahex%3A+'
         27        INIT_FCALL                                                   'bin2hex'
         28        SEND_VAR                                                     !0
         29        DO_ICALL                                             $20     
         30        CONCAT                                               ~21     ~17, $20
         31        CONCAT                                               ~22     ~21, '%0A'
         32        ECHO                                                         ~22
   12    33        FRAMELESS_ICALL_3                preg_replace        ~23     '%2F%5Cx%7B200B%7D%2Fu', ''
         34        OP_DATA                                                      !0
         35        ASSIGN                                                       !1, ~23
   13    36        ROPE_INIT                                         3  ~26     'out%3A+'
         37        ROPE_ADD                                          1  ~26     ~26, !1
         38        ROPE_END                                          2  ~25     ~26, '--%0Ahex%3A+'
         39        INIT_FCALL                                                   'bin2hex'
         40        SEND_VAR                                                     !1
         41        DO_ICALL                                             $28     
         42        CONCAT                                               ~29     ~25, $28
         43        CONCAT                                               ~30     ~29, '%0A%0A'
         44        ECHO                                                         ~30
         45      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.87 ms | 1737 KiB | 14 Q