3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(){ $inputEmails = array("@alpari.ru", "@alpari.org", "@forextime.com"); $clientEmail = "daniil.bugreev@alpari.org"; // quote symbols $emails = array_map(function ($item) { return preg_quote($item); }, $inputEmails); // check if (preg_match('/^.+(' . implode('|', $emails) . ')$/', $clientEmail)) { return true; } return false; } var_dump(test());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cTRE5
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'test'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cTRE5
function name:  test
number of ops:  22
compiled vars:  !0 = $inputEmails, !1 = $clientEmail, !2 = $emails
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 'daniil.bugreev%40alpari.org'
    8     2        INIT_FCALL                                               'array_map'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcTRE5%3A8%240'
   10     4        SEND_VAL                                                 ~5
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $6      
    8     7        ASSIGN                                                   !2, $6
   13     8        INIT_FCALL                                               'preg_match'
          9        INIT_FCALL                                               'implode'
         10        SEND_VAL                                                 '%7C'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $8      
         13        CONCAT                                           ~9      '%2F%5E.%2B%28', $8
         14        CONCAT                                           ~10     ~9, '%29%24%2F'
         15        SEND_VAL                                                 ~10
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $11     
         18      > JMPZ                                                     $11, ->20
   14    19    > > RETURN                                                   <true>
   17    20    > > RETURN                                                   <false>
   18    21*     > RETURN                                                   null

End of function test

Function %00%7Bclosure%7D%2Fin%2FcTRE5%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cTRE5
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'preg_quote'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   10     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcTRE5%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.64 ms | 1394 KiB | 24 Q