3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_email_pattern = '#[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}#i'; $author = ''; $author_email = 'jackjohnson@gmail.com'; if ((empty($author)) && (!empty($author_email))) { $_try_author = $author_email; if (strpos($_try_author, '@') !== false) { echo "valid email detected\n"; $_try_author = trim(preg_replace($_email_pattern, '', $_try_author)); $_try_author = trim(preg_replace('#[<()>\[\]._%+-]#',' ',$_try_author)); } else { echo "invalid email detected\n"; $author_email = ''; // not a valid email } $author = $_try_author; } echo 'AUTHOR: '.$author."\n"; echo 'AUTHOR EMAIL: '.$author_email."\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 39
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 36
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
Branch analysis from position: 8
filename:       /in/VGiPP
function name:  (null)
number of ops:  46
compiled vars:  !0 = $_email_pattern, !1 = $author, !2 = $author_email, !3 = $_try_author
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%23%5BA-Z0-9._%25%2B-%5D%2B%40%5BA-Z0-9.-%5D%2B%5C.%5BA-Z%5D%7B2%2C6%7D%23i'
    4     1        ASSIGN                                                   !1, ''
    5     2        ASSIGN                                                   !2, 'jackjohnson%40gmail.com'
    6     3        ISSET_ISEMPTY_CV                                 ~7      !1
          4      > JMPZ_EX                                          ~7      ~7, ->8
          5    >   ISSET_ISEMPTY_CV                                 ~8      !2
          6        BOOL_NOT                                         ~9      ~8
          7        BOOL                                             ~7      ~9
          8    > > JMPZ                                                     ~7, ->39
    7     9    >   ASSIGN                                                   !3, !2
    8    10        INIT_FCALL                                               'strpos'
         11        SEND_VAR                                                 !3
         12        SEND_VAL                                                 '%40'
         13        DO_ICALL                                         $11     
         14        TYPE_CHECK                                  1018          $11
         15      > JMPZ                                                     ~12, ->36
    9    16    >   ECHO                                                     'valid+email+detected%0A'
   10    17        INIT_FCALL                                               'trim'
         18        INIT_FCALL                                               'preg_replace'
         19        SEND_VAR                                                 !0
         20        SEND_VAL                                                 ''
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                         $13     
         23        SEND_VAR                                                 $13
         24        DO_ICALL                                         $14     
         25        ASSIGN                                                   !3, $14
   11    26        INIT_FCALL                                               'trim'
         27        INIT_FCALL                                               'preg_replace'
         28        SEND_VAL                                                 '%23%5B%3C%28%29%3E%5C%5B%5C%5D._%25%2B-%5D%23'
         29        SEND_VAL                                                 '+'
         30        SEND_VAR                                                 !3
         31        DO_ICALL                                         $16     
         32        SEND_VAR                                                 $16
         33        DO_ICALL                                         $17     
         34        ASSIGN                                                   !3, $17
         35      > JMP                                                      ->38
   13    36    >   ECHO                                                     'invalid+email+detected%0A'
   14    37        ASSIGN                                                   !2, ''
   16    38    >   ASSIGN                                                   !1, !3
   18    39    >   CONCAT                                           ~21     'AUTHOR%3A+', !1
         40        CONCAT                                           ~22     ~21, '%0A'
         41        ECHO                                                     ~22
   19    42        CONCAT                                           ~23     'AUTHOR+EMAIL%3A+', !2
         43        CONCAT                                           ~24     ~23, '%0A'
         44        ECHO                                                     ~24
         45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.98 ms | 1400 KiB | 19 Q