3v4l.org

run code in 500+ PHP versions simultaneously
<?php $recipients = ["kumar","ram@test.com","ravi","rob@example.com"]; $pattern = "/^[^\s@]+@[^\s@]+\.[^\s@]+$/"; $s = implode( ", ", array_map(fn($user) => preg_match($pattern, $user) ? $user : $user . "@test.com", $recipients) ); echo $s;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QSRQl
function name:  (null)
number of ops:  12
compiled vars:  !0 = $recipients, !1 = $pattern, !2 = $s
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, '%2F%5E%5B%5E%5Cs%40%5D%2B%40%5B%5E%5Cs%40%5D%2B%5C.%5B%5E%5Cs%40%5D%2B%24%2F'
    7     2        INIT_FCALL                                                   'array_map'
          3        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          4        BIND_LEXICAL                                                 ~5, !1
          5        SEND_VAL                                                     ~5
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                             $6      
    5     8        FRAMELESS_ICALL_2                implode             ~7      '%2C+', $6
          9        ASSIGN                                                       !2, ~7
   10    10        ECHO                                                         !2
   11    11      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QSRQl
function name:  {closure:/in/QSRQl:7}
number of ops:  10
compiled vars:  !0 = $user, !1 = $pattern
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
          2        FRAMELESS_ICALL_2                preg_match          ~2      !1, !0
          3      > JMPZ                                                         ~2, ->6
          4    >   QM_ASSIGN                                            ~3      !0
          5      > JMP                                                          ->8
          6    >   CONCAT                                               ~4      !0, '%40test.com'
          7        QM_ASSIGN                                            ~3      ~4
          8    > > RETURN                                                       ~3
          9*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
189.42 ms | 1731 KiB | 14 Q