3v4l.org

run code in 300+ PHP versions simultaneously
<?php $times = [ [ 'day' => 'Every Sunday', 'time' => '08:00', 'form' => 'normal', ], [ 'day' => 'Every Wednesday', 'time' => '17:00', 'form' => 'normal', ], [ 'day' => 'Every Monday', 'time' => '10:30', 'form' => 'special' , ], [ 'day' => 'Every Wednesday', 'time' => '17:01', 'form' => 'normal', ], ]; $filteredTimes = array_filter($times, function($v){ return isset($v['day']) && (false !== strpos($v['day'], 'Sunday') || false !== strpos($v['day'], 'Monday')); }); $matchingDays = count($filteredTimes); var_export($filteredTimes); var_dump($matchingDays);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uCUMr
function name:  (null)
number of ops:  16
compiled vars:  !0 = $times, !1 = $filteredTimes, !2 = $matchingDays
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   26     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FuCUMr%3A26%240'
   28     4        SEND_VAL                                                 ~4
          5        DO_ICALL                                         $5      
   26     6        ASSIGN                                                   !1, $5
   29     7        COUNT                                            ~7      !1
          8        ASSIGN                                                   !2, ~7
   31     9        INIT_FCALL                                               'var_export'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   32    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FuCUMr%3A26%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 18
filename:       /in/uCUMr
function name:  {closure}
number of ops:  20
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        ISSET_ISEMPTY_DIM_OBJ                         0  ~1      !0, 'day'
          2      > JMPZ_EX                                          ~1      ~1, ->18
          3    >   INIT_FCALL                                               'strpos'
          4        FETCH_DIM_R                                      ~2      !0, 'day'
          5        SEND_VAL                                                 ~2
          6        SEND_VAL                                                 'Sunday'
          7        DO_ICALL                                         $3      
          8        TYPE_CHECK                                  1018  ~4      $3
          9      > JMPNZ_EX                                         ~4      ~4, ->17
         10    >   INIT_FCALL                                               'strpos'
         11        FETCH_DIM_R                                      ~5      !0, 'day'
         12        SEND_VAL                                                 ~5
         13        SEND_VAL                                                 'Monday'
         14        DO_ICALL                                         $6      
         15        TYPE_CHECK                                  1018  ~7      $6
         16        BOOL                                             ~4      ~7
         17    >   BOOL                                             ~1      ~4
         18    > > RETURN                                                   ~1
   28    19*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FuCUMr%3A26%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.12 ms | 1400 KiB | 21 Q