3v4l.org

run code in 300+ PHP versions simultaneously
<?php // remove duplicated spaces into single spaces but persist special spaces like the non-breaking-space $normalized = "\xC2\xA1\xC2\xA0 "; $normalized = preg_replace("/([ \xC2\xA0])?\\s+/u", '$1 ', $normalized); $normalized = preg_replace('/([ \xC2\xA0]) /u', '$1', $normalized); var_dump($normalized, bin2hex($normalized));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VBKSr
function name:  (null)
number of ops:  21
compiled vars:  !0 = $normalized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '%C2%A1%C2%A0+'
    5     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%5B+%C2%A0%5D%29%3F%5Cs%2B%2Fu'
          3        SEND_VAL                                                 '%241+'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !0, $2
    6     7        INIT_FCALL                                               'preg_replace'
          8        SEND_VAL                                                 '%2F%28%5B+%5CxC2%5CxA0%5D%29+%2Fu'
          9        SEND_VAL                                                 '%241'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $4      
         12        ASSIGN                                                   !0, $4
    8    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !0
         15        INIT_FCALL                                               'bin2hex'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $6      
         18        SEND_VAR                                                 $6
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.08 ms | 1395 KiB | 19 Q