3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a= [['a', 10], ['b', 11], ['c', 12], ['d', 13]]; $b = [['k', 21], ['l', 22], ['m', 23], ['n', 24], ['o', 25]]; $cmp = 0; $diff = array_udiff($a, $b, function($o1, $o2) use ($cmp) { $cmp += 1; echo 'comparing ' . $o1[0] . ', ' . $o2[0] . PHP_EOL; return $o1[1] - $o2[1]; }); var_dump($cmp); var_dump($diff);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jupo5
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b, !2 = $cmp, !3 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    7     2        ASSIGN                                                   !2, 0
    9     3        INIT_FCALL                                               'array_udiff'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fjupo5%3A9%240'
          7        BIND_LEXICAL                                             ~7, !2
   13     8        SEND_VAL                                                 ~7
          9        DO_ICALL                                         $8      
    9    10        ASSIGN                                                   !3, $8
   15    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
   16    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fjupo5%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jupo5
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $o1, !1 = $o2, !2 = $cmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   10     3        ASSIGN_OP                                     1          !2, 1
   11     4        FETCH_DIM_R                                      ~4      !0, 0
          5        CONCAT                                           ~5      'comparing+', ~4
          6        CONCAT                                           ~6      ~5, '%2C+'
          7        FETCH_DIM_R                                      ~7      !1, 0
          8        CONCAT                                           ~8      ~6, ~7
          9        CONCAT                                           ~9      ~8, '%0A'
         10        ECHO                                                     ~9
   12    11        FETCH_DIM_R                                      ~10     !0, 1
         12        FETCH_DIM_R                                      ~11     !1, 1
         13        SUB                                              ~12     ~10, ~11
         14      > RETURN                                                   ~12
   13    15*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fjupo5%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.02 ms | 1396 KiB | 17 Q