3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = " Hi, my name is Petr"; echo preg_replace(array('/^\s+/', '/\s+/'), array('', ' '), $str) . "\n"; echo preg_replace('/(?<=^|\s)\s+/', '', $str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hk8AS
function name:  (null)
number of ops:  15
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '+++Hi%2C+my++name+is+%0A+++++++++Petr'
    5     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 <array>
          3        SEND_VAL                                                 <array>
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        CONCAT                                           ~3      $2, '%0A'
          7        ECHO                                                     ~3
    7     8        INIT_FCALL                                               'preg_replace'
          9        SEND_VAL                                                 '%2F%28%3F%3C%3D%5E%7C%5Cs%29%5Cs%2B%2F'
         10        SEND_VAL                                                 ''
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $4      
         13        ECHO                                                     $4
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.17 ms | 1000 KiB | 14 Q