3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = ['keep', 'remove', 'save', 'keep', 'save', 'delete']; $array2 = ['hold', 'remove', 'keep', 'retain', 'keep', 'delete']; $map = array_combine($array1,$array2); $map = array_filter($map ,function ($item) use (&$map) { $keep_data = ($item != key($map)); next($map); return $keep_data; }); $clean1 = array_keys($map); $clean2 = array_values($map); var_export($clean1); echo "<br />"; var_export($clean2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MdQ83
function name:  (null)
number of ops:  30
compiled vars:  !0 = $array1, !1 = $array2, !2 = $map, !3 = $clean1, !4 = $clean2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'array_combine'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
    7     7        INIT_FCALL                                               'array_filter'
          8        SEND_VAR                                                 !2
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FMdQ83%3A7%240'
         10        BIND_LEXICAL                                             ~9, !2
   11    11        SEND_VAL                                                 ~9
         12        DO_ICALL                                         $10     
    7    13        ASSIGN                                                   !2, $10
   13    14        INIT_FCALL                                               'array_keys'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !3, $12
   14    18        INIT_FCALL                                               'array_values'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $14     
         21        ASSIGN                                                   !4, $14
   16    22        INIT_FCALL                                               'var_export'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                                 
   17    25        ECHO                                                     '%3Cbr+%2F%3E'
   18    26        INIT_FCALL                                               'var_export'
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FMdQ83%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MdQ83
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $item, !1 = $map, !2 = $keep_data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    8     2        INIT_FCALL                                               'key'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $3      
          5        IS_NOT_EQUAL                                     ~4      !0, $3
          6        ASSIGN                                                   !2, ~4
    9     7        INIT_FCALL                                               'next'
          8        SEND_REF                                                 !1
          9        DO_ICALL                                                 
   10    10      > RETURN                                                   !2
   11    11*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FMdQ83%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.05 ms | 1400 KiB | 27 Q