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\xA0M\u212Bllorca\xC2\xA0 Urlaub \nSpass\xE2\x80\x88Spannung"; $normalized = preg_replace("/([ \xC2\xA0])?\\s+/u", '$1 ', $normalized); $normalized = preg_replace('/(\s) +/u', '$1', $normalized); var_dump($normalized);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EhANr
function name:  (null)
number of ops:  17
compiled vars:  !0 = $normalized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '+%C2%A0M%5Cu212Bllorca%C2%A0++++Urlaub+++%0ASpass%E2%80%88Spannung'
    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%5Cs%29+%2B%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        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.52 ms | 1394 KiB | 17 Q