3v4l.org

run code in 500+ PHP versions simultaneously
<?php $value = "Two spaces and one space and three spaces and ten spaces"; echo preg_replace('/ /', '<br>', $value); echo PHP_EOL; echo str_replace(" ", "<br>", $value); echo PHP_EOL; echo preg_replace('/\h{2}/', '<br>', $value);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3O6iT
function name:  (null)
number of ops:  13
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Two++spaces+and+one+space+and+three+++spaces+and+ten++++++++++spaces'
    4     1        FRAMELESS_ICALL_3                preg_replace        ~2      '%2F++%2F', '%3Cbr%3E'
          2        OP_DATA                                                      !0
          3        ECHO                                                         ~2
    5     4        ECHO                                                         '%0A'
    6     5        FRAMELESS_ICALL_3                str_replace         ~3      '++', '%3Cbr%3E'
          6        OP_DATA                                                      !0
          7        ECHO                                                         ~3
    7     8        ECHO                                                         '%0A'
    8     9        FRAMELESS_ICALL_3                preg_replace        ~4      '%2F%5Ch%7B2%7D%2F', '%3Cbr%3E'
         10        OP_DATA                                                      !0
         11        ECHO                                                         ~4
         12      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.26 ms | 2614 KiB | 13 Q