3v4l.org

run code in 300+ 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:  11
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        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 ''
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
244.3 ms | 1002 KiB | 15 Q