3v4l.org

run code in 500+ 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:  10
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        FRAMELESS_ICALL_3                preg_replace        ~2      '%2F%5B%0A%5D%2A%2F', '%0A'
          2        OP_DATA                                                      !0
          3        ASSIGN                                                       !0, ~2
   12     4        INIT_FCALL                                                   'var_export'
   13     5        FRAMELESS_ICALL_3                preg_replace        ~4      '%2F%5B+%09%5D%2A%2F', '+'
          6        OP_DATA                                                      !0
          7        SEND_VAL                                                     ~4
   12     8        DO_ICALL                                                     
   14     9      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.87 ms | 3436 KiB | 14 Q