3v4l.org

run code in 300+ 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:  52
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        INIT_FCALL                                               'preg_replace'
         12        SEND_VAL                                                 '%2F%5CxE2%5Cx80%5Cx8B%2F'
         13        SEND_VAL                                                 ''
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !1, $9
    8    17        ROPE_INIT                                     3  ~12     'out%3A+'
         18        ROPE_ADD                                      1  ~12     ~12, !1
         19        ROPE_END                                      2  ~11     ~12, '--%0Ahex%3A+'
         20        INIT_FCALL                                               'bin2hex'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $14     
         23        CONCAT                                           ~15     ~11, $14
         24        CONCAT                                           ~16     ~15, '%0A%0A'
         25        ECHO                                                     ~16
   10    26        ECHO                                                     'UTF-8+mode%3A+match+a+Unicode+code+point%0A-----%0A'
   11    27        ROPE_INIT                                     3  ~18     'in%3A+'
         28        ROPE_ADD                                      1  ~18     ~18, !0
         29        ROPE_END                                      2  ~17     ~18, '--%0Ahex%3A+'
         30        INIT_FCALL                                               'bin2hex'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                         $20     
         33        CONCAT                                           ~21     ~17, $20
         34        CONCAT                                           ~22     ~21, '%0A'
         35        ECHO                                                     ~22
   12    36        INIT_FCALL                                               'preg_replace'
         37        SEND_VAL                                                 '%2F%5Cx%7B200B%7D%2Fu'
         38        SEND_VAL                                                 ''
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                         $23     
         41        ASSIGN                                                   !1, $23
   13    42        ROPE_INIT                                     3  ~26     'out%3A+'
         43        ROPE_ADD                                      1  ~26     ~26, !1
         44        ROPE_END                                      2  ~25     ~26, '--%0Ahex%3A+'
         45        INIT_FCALL                                               'bin2hex'
         46        SEND_VAR                                                 !1
         47        DO_ICALL                                         $28     
         48        CONCAT                                           ~29     ~25, $28
         49        CONCAT                                           ~30     ~29, '%0A%0A'
         50        ECHO                                                     ~30
         51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
212.27 ms | 1011 KiB | 15 Q