3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'a\\\\,b,c\\,d'; print_r(preg_split('/(?<![^\\\\][\\\\]),/', $str)); print_r(preg_split('/(?<!(?<!\\\\)\\\\),/', $str)); print_r(preg_split('/(?<![^\\\\])(?<!\\\\),/', $str));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bZs7J
function name:  (null)
number of ops:  23
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'a%5C%5C%2Cb%2Cc%5C%2Cd'
    4     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'preg_split'
          3        SEND_VAL                                                 '%2F%28%3F%3C%21%5B%5E%5C%5C%5D%5B%5C%5C%5D%29%2C%2F'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
    5     8        INIT_FCALL                                               'print_r'
          9        INIT_FCALL                                               'preg_split'
         10        SEND_VAL                                                 '%2F%28%3F%3C%21%28%3F%3C%21%5C%5C%29%5C%5C%29%2C%2F'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                                 
    6    15        INIT_FCALL                                               'print_r'
         16        INIT_FCALL                                               'preg_split'
         17        SEND_VAL                                                 '%2F%28%3F%3C%21%5B%5E%5C%5C%5D%29%28%3F%3C%21%5C%5C%29%2C%2F'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $6      
         20        SEND_VAR                                                 $6
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.19 ms | 1395 KiB | 17 Q