3v4l.org

run code in 500+ PHP versions simultaneously
<?php $strs = ['2 + 2', 'f( " ")', 'f("Test \\"mystring\\" .")', 'f("\' ", " ")']; $rx = '~(?<!\\\\)(?:\\\\{2})*(?:"[^\\\\"]*(?:\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\')(*SKIP)(*F)|\h+~s'; print_r( preg_replace($rx, '', $strs) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NhcMo
function name:  (null)
number of ops:  8
compiled vars:  !0 = $strs, !1 = $rx
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, '%7E%28%3F%3C%21%5C%5C%29%28%3F%3A%5C%5C%7B2%7D%29%2A%28%3F%3A%22%5B%5E%5C%5C%22%5D%2A%28%3F%3A%5C%5C.%5B%5E%22%5C%5C%5D%2A%29%2A%22%7C%27%5B%5E%27%5C%5C%5D%2A%28%3F%3A%5C%5C.%5B%5E%27%5C%5C%5D%2A%29%2A%27%29%28%2ASKIP%29%28%2AF%29%7C%5Ch%2B%7Es'
    5     2        INIT_FCALL                                                   'print_r'
          3        FRAMELESS_ICALL_3                preg_replace        ~4      !1, ''
          4        OP_DATA                                                      !0
          5        SEND_VAL                                                     ~4
          6        DO_ICALL                                                     
          7      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.51 ms | 2123 KiB | 14 Q