3v4l.org

run code in 500+ 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:  9
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        FRAMELESS_ICALL_3                preg_replace        ~2      <array>, <array>
          2        OP_DATA                                                      !0
          3        CONCAT                                               ~3      ~2, '%0A'
          4        ECHO                                                         ~3
    7     5        FRAMELESS_ICALL_3                preg_replace        ~4      '%2F%28%3F%3C%3D%5E%7C%5Cs%29%5Cs%2B%2F', ''
          6        OP_DATA                                                      !0
          7        ECHO                                                         ~4
          8      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.04 ms | 2092 KiB | 13 Q