3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = '(((?!a).)*)*'; $test_string = 'AAAAAAAAAAAAAA{AA'; echo "1:".mb_ereg_replace($regex,'WORKED',$test_string)."\n"; echo "2:".preg_replace('/'.$regex.'/u','WORKED',$test_string)."\n"; echo "3:".preg_replace('/'.$regex.'/','WORKED',$test_string)."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RQDnH
function name:  (null)
number of ops:  31
compiled vars:  !0 = $regex, !1 = $test_string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%28%28%28%3F%21a%29.%29%2A%29%2A'
    3     1        ASSIGN                                                   !1, 'AAAAAAAAAAAAAA%7BAA'
    4     2        INIT_FCALL                                               'mb_ereg_replace'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'WORKED'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7        CONCAT                                           ~5      '1%3A', $4
          8        CONCAT                                           ~6      ~5, '%0A'
          9        ECHO                                                     ~6
    5    10        INIT_FCALL                                               'preg_replace'
         11        CONCAT                                           ~7      '%2F', !0
         12        CONCAT                                           ~8      ~7, '%2Fu'
         13        SEND_VAL                                                 ~8
         14        SEND_VAL                                                 'WORKED'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $9      
         17        CONCAT                                           ~10     '2%3A', $9
         18        CONCAT                                           ~11     ~10, '%0A'
         19        ECHO                                                     ~11
    6    20        INIT_FCALL                                               'preg_replace'
         21        CONCAT                                           ~12     '%2F', !0
         22        CONCAT                                           ~13     ~12, '%2F'
         23        SEND_VAL                                                 ~13
         24        SEND_VAL                                                 'WORKED'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                         $14     
         27        CONCAT                                           ~15     '3%3A', $14
         28        CONCAT                                           ~16     ~15, '%0A'
         29        ECHO                                                     ~16
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.34 ms | 936 KiB | 18 Q