3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stocks = [ "stock0" => 1, "stockdate0" => '', "stock1" => 3, "stockdate1" => 'apple', "stock4DON'TMATCHTHIS!!!" => 4, "stock2" => 2, "stockdate2" => '', "stock33" => 333, "stockdate33" => '' ]; $find = 'stock'; var_export( array_filter($stocks, fn($k) => rtrim($k, '0..9') === $find, ARRAY_FILTER_USE_KEY) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ERs5t
function name:  (null)
number of ops:  13
compiled vars:  !0 = $stocks, !1 = $find
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, 'stock'
   16     2        INIT_FCALL                                               'var_export'
   17     3        INIT_FCALL                                               'array_filter'
          4        SEND_VAR                                                 !0
          5        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          6        BIND_LEXICAL                                             ~4, !1
          7        SEND_VAL                                                 ~4
          8        SEND_VAL                                                 2
          9        DO_ICALL                                         $5      
         10        SEND_VAR                                                 $5
   16    11        DO_ICALL                                                 
   18    12      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ERs5t
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $k, !1 = $find
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        INIT_FCALL                                               'rtrim'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 '0..9'
          5        DO_ICALL                                         $2      
          6        IS_IDENTICAL                                     ~3      !1, $2
          7      > RETURN                                                   ~3
          8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.07 ms | 1004 KiB | 16 Q