3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "( 小黄蜂250 OR 小黄峰 OR 幻影150 ) "; var_dump($str = preg_replace('/\(\s?(^\s.*^\s)\s?\)/', '($1)', $str));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VntQY
function name:  (null)
number of ops:  11
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%28+%E5%B0%8F%E9%BB%84%E8%9C%82250+OR+%E5%B0%8F%E9%BB%84%E5%B3%B0+OR++%E5%B9%BB%E5%BD%B1150+%29+'
    3     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%2F%5C%28%5Cs%3F%28%5E%5Cs.%2A%5E%5Cs%29%5Cs%3F%5C%29%2F'
          4        SEND_VAL                                                 '%28%241%29'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        ASSIGN                                           ~3      !0, $2
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.8 ms | 1385 KiB | 17 Q