3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ "date_2018_08" => 81, "date_2018_09" => 70, "date_2018_10" => 70, "date_2018_11" => 95, "date_2018_12" => 75, "date_2019_01" => 91, "date_2019_02" => 78, "date_2019_03" => 95, "date_2019_04" => 68, ]; $year = 2019; $month = str_pad(4,2,"0",STR_PAD_LEFT); $temp = array_filter($array, function ($key) use ($year, $month) { return (strpos($key, $year . "_" . $month) === false); }, ARRAY_FILTER_USE_KEY); print_r($temp);die;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/hOUpG
function name:  (null)
number of ops:  23
compiled vars:  !0 = $array, !1 = $year, !2 = $month, !3 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   13     1        ASSIGN                                                   !1, 2019
   14     2        INIT_FCALL                                               'str_pad'
          3        SEND_VAL                                                 4
          4        SEND_VAL                                                 2
          5        SEND_VAL                                                 '0'
          6        SEND_VAL                                                 0
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !2, $6
   15     9        INIT_FCALL                                               'array_filter'
         10        SEND_VAR                                                 !0
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhOUpG%3A15%240'
         12        BIND_LEXICAL                                             ~8, !1
         13        BIND_LEXICAL                                             ~8, !2
   17    14        SEND_VAL                                                 ~8
         15        SEND_VAL                                                 2
         16        DO_ICALL                                         $9      
   15    17        ASSIGN                                                   !3, $9
   18    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                                 
         21      > EXIT                                                     
   19    22*     > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FhOUpG%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hOUpG
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $key, !1 = $year, !2 = $month
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
   16     3        INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !0
          5        CONCAT                                           ~3      !1, '_'
          6        CONCAT                                           ~4      ~3, !2
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                         $5      
          9        TYPE_CHECK                                    4  ~6      $5
         10      > RETURN                                                   ~6
   17    11*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FhOUpG%3A15%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.14 ms | 1400 KiB | 21 Q