3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( 0 => array('value' => 1000, 'name' => 'AA1'), 1 => array('value' => 2000, 'name' => 'AA2'), 2 => array('value' => 3000, 'name' => 'AA3'), 3 => array('value' => 4000, 'name' => 'AA4'), ); $b = array( 0 => array('value' => 1000, 'name' => 'BB1'), 1 => array('value' => 3000, 'name' => 'BB2'), 2 => array('value' => 1700, 'name' => 'BB3'), 3 => array('value' => 1200, 'name' => 'BB4'), ); $c = array( 0 => array('value' => 3000, 'name' => 'CC1'), 1 => array('value' => 4000, 'name' => 'CC2'), 2 => array('value' => 4300, 'name' => 'CC3'), 3 => array('value' => 5000, 'name' => 'CC4'), ); $result = array_uintersect($a, $b, $c, function($x, $y) { return $x['value'] - $y['value']; }); $result = array_map(function($x) use ($a) { return ['value'=>$x['value'], 'name'=>$a['name']]; }, $result); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YmX4Y
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   15     2        ASSIGN                                                   !2, <array>
   22     3        INIT_FCALL                                               'array_uintersect'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYmX4Y%3A22%240'
   25     8        SEND_VAL                                                 ~7
          9        DO_ICALL                                         $8      
   22    10        ASSIGN                                                   !3, $8
   26    11        INIT_FCALL                                               'array_map'
         12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYmX4Y%3A26%241'
         13        BIND_LEXICAL                                             ~10, !0
   29    14        SEND_VAL                                                 ~10
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $11     
   26    17        ASSIGN                                                   !3, $11
   31    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FYmX4Y%3A22%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YmX4Y
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   24     2        FETCH_DIM_R                                      ~2      !0, 'value'
          3        FETCH_DIM_R                                      ~3      !1, 'value'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
   25     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYmX4Y%3A22%240

Function %00%7Bclosure%7D%2Fin%2FYmX4Y%3A26%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YmX4Y
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $x, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   28     2        FETCH_DIM_R                                      ~2      !0, 'value'
          3        INIT_ARRAY                                       ~3      ~2, 'value'
          4        FETCH_DIM_R                                      ~4      !1, 'name'
          5        ADD_ARRAY_ELEMENT                                ~3      ~4, 'name'
          6      > RETURN                                                   ~3
   29     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYmX4Y%3A26%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.34 ms | 1400 KiB | 19 Q