3v4l.org

run code in 300+ PHP versions simultaneously
<?php t_ereg("d"); t_ereg("c"); t_ereg("ct"); t_ereg("coat"); t_ereg("do"); t_ereg("dog"); t_ereg("dogcat"); t_ereg("docat"); t_ereg("doc"); t_ereg("cat"); t_ereg("c1234abct"); function t_ereg ( $line ) { $pattern='dog|c*t'; echo "$pattern=>\"$line\":"; echo (preg_match("/$pattern/", $line))?"1":"0"; echo "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T0rr7
function name:  (null)
number of ops:  34
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       't_ereg'
          1        SEND_VAL_EX                                              'd'
          2        DO_FCALL                                      0          
    3     3        INIT_FCALL_BY_NAME                                       't_ereg'
          4        SEND_VAL_EX                                              'c'
          5        DO_FCALL                                      0          
    4     6        INIT_FCALL_BY_NAME                                       't_ereg'
          7        SEND_VAL_EX                                              'ct'
          8        DO_FCALL                                      0          
    5     9        INIT_FCALL_BY_NAME                                       't_ereg'
         10        SEND_VAL_EX                                              'coat'
         11        DO_FCALL                                      0          
    6    12        INIT_FCALL_BY_NAME                                       't_ereg'
         13        SEND_VAL_EX                                              'do'
         14        DO_FCALL                                      0          
    7    15        INIT_FCALL_BY_NAME                                       't_ereg'
         16        SEND_VAL_EX                                              'dog'
         17        DO_FCALL                                      0          
    8    18        INIT_FCALL_BY_NAME                                       't_ereg'
         19        SEND_VAL_EX                                              'dogcat'
         20        DO_FCALL                                      0          
    9    21        INIT_FCALL_BY_NAME                                       't_ereg'
         22        SEND_VAL_EX                                              'docat'
         23        DO_FCALL                                      0          
   10    24        INIT_FCALL_BY_NAME                                       't_ereg'
         25        SEND_VAL_EX                                              'doc'
         26        DO_FCALL                                      0          
   11    27        INIT_FCALL_BY_NAME                                       't_ereg'
         28        SEND_VAL_EX                                              'cat'
         29        DO_FCALL                                      0          
   12    30        INIT_FCALL_BY_NAME                                       't_ereg'
         31        SEND_VAL_EX                                              'c1234abct'
         32        DO_FCALL                                      0          
   20    33      > RETURN                                                   1

Function t_ereg:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T0rr7
function name:  t_ereg
number of ops:  21
compiled vars:  !0 = $line, !1 = $pattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        ASSIGN                                                   !1, 'dog%7Cc%2At'
   17     2        ROPE_INIT                                     4  ~4      !1
          3        ROPE_ADD                                      1  ~4      ~4, '%3D%3E%22'
          4        ROPE_ADD                                      2  ~4      ~4, !0
          5        ROPE_END                                      3  ~3      ~4, '%22%3A'
          6        ECHO                                                     ~3
   18     7        INIT_FCALL                                               'preg_match'
          8        ROPE_INIT                                     3  ~7      '%2F'
          9        ROPE_ADD                                      1  ~7      ~7, !1
         10        ROPE_END                                      2  ~6      ~7, '%2F'
         11        SEND_VAL                                                 ~6
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $9      
         14      > JMPZ                                                     $9, ->17
         15    >   QM_ASSIGN                                        ~10     '1'
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~10     '0'
         18    >   ECHO                                                     ~10
   19    19        ECHO                                                     '%0A'
   20    20      > RETURN                                                   null

End of function t_ereg

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.98 ms | 1400 KiB | 15 Q