3v4l.org

run code in 500+ PHP versions simultaneously
<?php $movements = [ ['id' => 90415, 'oldDate' => '2024-08-27', 'newDate' => '2024-08-28'], ['id' => 90415, 'oldDate' => '2024-08-28', 'newDate' => '2024-08-27'], ['id' => 90409, 'oldDate' => '2024-08-21', 'newDate' => '2024-08-22'], ['id' => 90409, 'oldDate' => '2024-08-22', 'newDate' => '2024-08-23'], ]; var_export( array_values( array_filter( array_reduce( $movements, function($carry, $move) { $carry[$move['id']] ??= $move; $carry[$move['id']]['newDate'] = $move['newDate']; return $carry; } ), fn($move) => $move['oldDate'] != $move['newDate'] ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VWk54
function name:  (null)
number of ops:  18
compiled vars:  !0 = $movements
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1        INIT_FCALL                                                   'var_export'
   11     2        INIT_FCALL                                                   'array_values'
   12     3        INIT_FCALL                                                   'array_filter'
   13     4        INIT_FCALL                                                   'array_reduce'
   14     5        SEND_VAR                                                     !0
   15     6        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   19     7        SEND_VAL                                                     ~2
   13     8        DO_ICALL                                             $3      
   19     9        SEND_VAR                                                     $3
   21    10        DECLARE_LAMBDA_FUNCTION                              ~4      [1]
   22    11        SEND_VAL                                                     ~4
   12    12        DO_ICALL                                             $5      
   22    13        SEND_VAR                                                     $5
   11    14        DO_ICALL                                             $6      
   22    15        SEND_VAR                                                     $6
   10    16        DO_ICALL                                                     
   24    17      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VWk54
function name:  {closure:/in/VWk54:15}
number of ops:  19
compiled vars:  !0 = $carry, !1 = $move
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   16     2        FETCH_DIM_R                                          ~2      !1, 'id'
          3        COPY_TMP                                             ~3      ~2
          4        FETCH_DIM_IS                                         ~4      !0, ~2
          5        COALESCE                                             ~5      ~4
          6        ASSIGN_DIM                                           ~6      !0, ~3
          7        OP_DATA                                                      !1
          8        QM_ASSIGN                                            ~5      ~6
          9      > JMP                                                          ->11
         10*       FREE                                                         ~3
         11    >   FREE                                                         ~5
   17    12        FETCH_DIM_R                                          ~7      !1, 'id'
         13        FETCH_DIM_R                                          ~10     !1, 'newDate'
         14        FETCH_DIM_W                                          $8      !0, ~7
         15        ASSIGN_DIM                                                   $8, 'newDate'
         16        OP_DATA                                                      ~10
   18    17      > RETURN                                                       !0
   19    18*     > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VWk54
function name:  {closure:/in/VWk54:21}
number of ops:  6
compiled vars:  !0 = $move
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   RECV                                                 !0      
          1        FETCH_DIM_R                                          ~1      !0, 'oldDate'
          2        FETCH_DIM_R                                          ~2      !0, 'newDate'
          3        IS_NOT_EQUAL                                         ~3      ~1, ~2
          4      > RETURN                                                       ~3
   22     5*     > RETURN                                                       null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.45 ms | 1607 KiB | 17 Q