3v4l.org

run code in 300+ PHP versions simultaneously
<?php $message = array( 'to' => array( array( 'foo'=>'bar', 'email' => 'blablab'), array('bar'=>'foo1', 'email' => 'test@example.com'), array('bar'=>'foo2', 'email' => 'test@wp.com'), array('bar'=>'fo3', 'email' => 'test@blabla.com'), array('bar'=>'foo4', 'email' => 'test@onet.com'), array('bar'=>'foo5', 'email' => 'test@example.com'), array('bar'=>'foo6', 'email' => 'test@gmail.com') )); $recipients = array_filter($message['to'], function ($to) { $found = preg_match('/@.*\.?example\./i', $to['email'], $result); return !($found !== 0 && $found !== false); }); var_dump($recipients);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iQpJO
function name:  (null)
number of ops:  12
compiled vars:  !0 = $message, !1 = $recipients
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'array_filter'
          2        FETCH_DIM_R                                      ~3      !0, 'to'
          3        SEND_VAL                                                 ~3
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FiQpJO%3A12%240'
   16     5        SEND_VAL                                                 ~4
          6        DO_ICALL                                         $5      
   12     7        ASSIGN                                                   !1, $5
   17     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FiQpJO%3A12%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/iQpJO
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $to, !1 = $found, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%40.%2A%5C.%3Fexample%5C.%2Fi'
          3        FETCH_DIM_R                                      ~3      !0, 'email'
          4        SEND_VAL                                                 ~3
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !1, $4
   15     8        IS_NOT_IDENTICAL                                 ~6      !1, 0
          9      > JMPZ_EX                                          ~6      ~6, ->12
         10    >   TYPE_CHECK                                  1018  ~7      !1
         11        BOOL                                             ~6      ~7
         12    >   BOOL_NOT                                         ~8      ~6
         13      > RETURN                                                   ~8
   16    14*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FiQpJO%3A12%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.63 ms | 1396 KiB | 19 Q