3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.37 ms | 1396 KiB | 17 Q