3v4l.org

run code in 300+ 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:  37
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        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F++%2B%2F'
          3        SEND_VAL                                                 '_'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !0, $2
    4     7        CONCAT                                           ~4      !0, '%0A'
          8        ECHO                                                     ~4
    6     9        ASSIGN                                                   !0, 'this+has+++lots++++of++++spaces'
    7    10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%2F%5Cs%2B%2F'
         12        SEND_VAL                                                 '_'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $6      
         15        ASSIGN                                                   !0, $6
    8    16        CONCAT                                           ~8      !0, '%0A'
         17        ECHO                                                     ~8
   10    18        ASSIGN                                                   !0, 'this+has+one%09tab+and+lots+of+%09%09tabs'
   11    19        INIT_FCALL                                               'preg_replace'
         20        SEND_VAL                                                 '%2F++%2B%2F'
         21        SEND_VAL                                                 '_'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $10     
         24        ASSIGN                                                   !0, $10
   12    25        CONCAT                                           ~12     !0, '%0A'
         26        ECHO                                                     ~12
   15    27        ASSIGN                                                   !0, 'this+has+one%09tab+and+lots+of+%09%09tabs'
   16    28        INIT_FCALL                                               'preg_replace'
         29        SEND_VAL                                                 '%2F%5Cs%2B%2F'
         30        SEND_VAL                                                 '_'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                         $14     
         33        ASSIGN                                                   !0, $14
   17    34        CONCAT                                           ~16     !0, '%0A'
         35        ECHO                                                     ~16
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.57 ms | 1011 KiB | 14 Q