3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = 'ananas'; $re = "^an|^ananas"; ereg($re, $str, $m); echo "$re\n", print_r($m, true), "\n"; $re = "^an.|^an(.)"; ereg($re, $str, $m); echo "$re\n", print_r($m, true), "\n"; $re = "^an(.)|^an."; ereg($re, $str, $m); echo "$re\n", print_r($m, true);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MajCl
function name:  (null)
number of ops:  46
compiled vars:  !0 = $str, !1 = $re, !2 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'ananas'
    4     1        ASSIGN                                                       !1, '%5Ean%7C%5Eananas'
    5     2        INIT_FCALL_BY_NAME                                           'ereg'
          3        SEND_VAR_EX                                                  !1
          4        SEND_VAR_EX                                                  !0
          5        SEND_VAR_EX                                                  !2
          6        DO_FCALL                                          0          
    6     7        NOP                                                          
          8        FAST_CONCAT                                          ~6      !1, '%0A'
          9        ECHO                                                         ~6
         10        INIT_FCALL                                                   'print_r'
         11        SEND_VAR                                                     !2
         12        SEND_VAL                                                     <true>
         13        DO_ICALL                                             $7      
         14        ECHO                                                         $7
         15        ECHO                                                         '%0A'
    8    16        ASSIGN                                                       !1, '%5Ean.%7C%5Ean%28.%29'
    9    17        INIT_FCALL_BY_NAME                                           'ereg'
         18        SEND_VAR_EX                                                  !1
         19        SEND_VAR_EX                                                  !0
         20        SEND_VAR_EX                                                  !2
         21        DO_FCALL                                          0          
   10    22        NOP                                                          
         23        FAST_CONCAT                                          ~10     !1, '%0A'
         24        ECHO                                                         ~10
         25        INIT_FCALL                                                   'print_r'
         26        SEND_VAR                                                     !2
         27        SEND_VAL                                                     <true>
         28        DO_ICALL                                             $11     
         29        ECHO                                                         $11
         30        ECHO                                                         '%0A'
   13    31        ASSIGN                                                       !1, '%5Ean%28.%29%7C%5Ean.'
   14    32        INIT_FCALL_BY_NAME                                           'ereg'
         33        SEND_VAR_EX                                                  !1
         34        SEND_VAR_EX                                                  !0
         35        SEND_VAR_EX                                                  !2
         36        DO_FCALL                                          0          
   15    37        NOP                                                          
         38        FAST_CONCAT                                          ~14     !1, '%0A'
         39        ECHO                                                         ~14
         40        INIT_FCALL                                                   'print_r'
         41        SEND_VAR                                                     !2
         42        SEND_VAL                                                     <true>
         43        DO_ICALL                                             $15     
         44        ECHO                                                         $15
         45      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.37 ms | 2120 KiB | 14 Q