3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo preg_replace('~^[\pZ\pC]+|[\pZ\pC]+$|(?! )[\pZ\pC]~u', '', 'abc def ghi   ').PHP_EOL; echo preg_replace('/^\s+|\s+$|[^\S ]/u', '', 'abc def ghi   ');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lkrHV
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'preg_replace'
          1        SEND_VAL                                                 '%7E%5E%5B%5CpZ%5CpC%5D%2B%7C%5B%5CpZ%5CpC%5D%2B%24%7C%28%3F%21+%29%5B%5CpZ%5CpC%5D%7Eu'
          2        SEND_VAL                                                 ''
          3        SEND_VAL                                                 'abc+def%C2%A0ghi%09%C2%A0+'
          4        DO_ICALL                                         $0      
          5        CONCAT                                           ~1      $0, '%0A'
          6        ECHO                                                     ~1
    4     7        INIT_FCALL                                               'preg_replace'
          8        SEND_VAL                                                 '%2F%5E%5Cs%2B%7C%5Cs%2B%24%7C%5B%5E%5CS+%5D%2Fu'
          9        SEND_VAL                                                 ''
         10        SEND_VAL                                                 'abc+def%C2%A0ghi%09%C2%A0+'
         11        DO_ICALL                                         $2      
         12        ECHO                                                     $2
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.32 ms | 998 KiB | 14 Q