3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = " 12| 150 | test one| 33235 13| 151| test two |33236 "; $pattern = '/(?:\s\|\s)|(?:\s\|)|(?:\|\s)/'; echo preg_replace($pattern, '|', $string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IDnpa
function name:  (null)
number of ops:  6
compiled vars:  !0 = $string, !1 = $pattern
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%0A12%7C+150+%7C+test+one%7C+33235%0A13%7C+151%7C+test+two+%7C33236%0A'
    7     1        ASSIGN                                                       !1, '%2F%28%3F%3A%5Cs%5C%7C%5Cs%29%7C%28%3F%3A%5Cs%5C%7C%29%7C%28%3F%3A%5C%7C%5Cs%29%2F'
    9     2        FRAMELESS_ICALL_3                preg_replace        ~4      !1, '%7C'
          3        OP_DATA                                                      !0
          4        ECHO                                                         ~4
          5      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
192.36 ms | 1945 KiB | 13 Q