3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "My text has so much whitespace Plenty of spaces and tabs"; //Remove duplicate newlines $string = preg_replace("/[\n]*/", "\n", $string); //Preserves newlines while replacing the other whitspaces with single space var_export( preg_replace("/[ \t]*/", " ", $string) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7UXTJ
function name:  (null)
number of ops:  16
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'My++++text+++++++has+so++++much+++whitespace++++%0A%0A%0A%0A%0APlenty+of++++spaces++and++++++++++++tabs'
   10     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5B%0A%5D%2A%2F'
          3        SEND_VAL                                                 '%0A'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !0, $2
   12     7        INIT_FCALL                                               'var_export'
   13     8        INIT_FCALL                                               'preg_replace'
          9        SEND_VAL                                                 '%2F%5B+%09%5D%2A%2F'
         10        SEND_VAL                                                 '+'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $4      
         13        SEND_VAR                                                 $4
   12    14        DO_ICALL                                                 
   14    15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.72 ms | 1000 KiB | 15 Q