3v4l.org

run code in 500+ PHP versions simultaneously
<?php $name = 'this has lots of spaces'; $name = preg_replace('/ +/', '_', $name); print $name . PHP_EOL; $name = 'this has lots of spaces'; $name = preg_replace('/\s+/', '_', $name); print $name . PHP_EOL; $name = 'this has one tab and lots of tabs'; $name = preg_replace('/ +/', '_', $name); print $name . PHP_EOL; $name = 'this has one tab and lots of tabs'; $name = preg_replace('/\s+/', '_', $name); print $name . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9QuIs
function name:  (null)
number of ops:  25
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'this+has+++lots++++of++++spaces'
    3     1        FRAMELESS_ICALL_3                preg_replace        ~2      '%2F++%2B%2F', '_'
          2        OP_DATA                                                      !0
          3        ASSIGN                                                       !0, ~2
    4     4        CONCAT                                               ~4      !0, '%0A'
          5        ECHO                                                         ~4
    6     6        ASSIGN                                                       !0, 'this+has+++lots++++of++++spaces'
    7     7        FRAMELESS_ICALL_3                preg_replace        ~6      '%2F%5Cs%2B%2F', '_'
          8        OP_DATA                                                      !0
          9        ASSIGN                                                       !0, ~6
    8    10        CONCAT                                               ~8      !0, '%0A'
         11        ECHO                                                         ~8
   10    12        ASSIGN                                                       !0, 'this+has+one%09tab+and+lots+of+%09%09tabs'
   11    13        FRAMELESS_ICALL_3                preg_replace        ~10     '%2F++%2B%2F', '_'
         14        OP_DATA                                                      !0
         15        ASSIGN                                                       !0, ~10
   12    16        CONCAT                                               ~12     !0, '%0A'
         17        ECHO                                                         ~12
   15    18        ASSIGN                                                       !0, 'this+has+one%09tab+and+lots+of+%09%09tabs'
   16    19        FRAMELESS_ICALL_3                preg_replace        ~14     '%2F%5Cs%2B%2F', '_'
         20        OP_DATA                                                      !0
         21        ASSIGN                                                       !0, ~14
   17    22        CONCAT                                               ~16     !0, '%0A'
         23        ECHO                                                         ~16
         24      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
223.54 ms | 2813 KiB | 13 Q