3v4l.org

run code in 300+ PHP versions simultaneously
<?php $compare = function($a, $b) use(&$iteration_count) { // echo("$a : $b\n"); $iteration_count++; return strcmp($a, $b); }; $a = array('11', '21', '31', '41', '11'); $b = array('12', '22', '32', '42', '52', '11'); $iteration_count = 0; var_dump(array_udiff($a, $b, $compare)); var_dump($iteration_count); echo "\n\n"; $iteration_count = 0; $a_new = array_combine($a, array_fill(0, count($a), 1)); $b_new = array_combine($b, array_fill(0, count($b), 1)); var_dump(array_diff_uassoc($a_new, $b_new, $compare)); var_dump($iteration_count); echo "\n\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lFQUm
function name:  (null)
number of ops:  54
compiled vars:  !0 = $compare, !1 = $iteration_count, !2 = $a, !3 = $b, !4 = $a_new, !5 = $b_new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FlFQUm%3A3%240'
          1        BIND_LEXICAL                                             ~6, !1
          2        ASSIGN                                                   !0, ~6
   10     3        ASSIGN                                                   !2, <array>
   11     4        ASSIGN                                                   !3, <array>
   13     5        ASSIGN                                                   !1, 0
   14     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'array_udiff'
          8        SEND_VAR                                                 !2
          9        SEND_VAR                                                 !3
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $11     
         12        SEND_VAR                                                 $11
         13        DO_ICALL                                                 
   15    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
   16    17        ECHO                                                     '%0A%0A'
   18    18        ASSIGN                                                   !1, 0
   19    19        INIT_FCALL                                               'array_combine'
         20        SEND_VAR                                                 !2
         21        INIT_FCALL                                               'array_fill'
         22        SEND_VAL                                                 0
         23        COUNT                                            ~15     !2
         24        SEND_VAL                                                 ~15
         25        SEND_VAL                                                 1
         26        DO_ICALL                                         $16     
         27        SEND_VAR                                                 $16
         28        DO_ICALL                                         $17     
         29        ASSIGN                                                   !4, $17
   20    30        INIT_FCALL                                               'array_combine'
         31        SEND_VAR                                                 !3
         32        INIT_FCALL                                               'array_fill'
         33        SEND_VAL                                                 0
         34        COUNT                                            ~19     !3
         35        SEND_VAL                                                 ~19
         36        SEND_VAL                                                 1
         37        DO_ICALL                                         $20     
         38        SEND_VAR                                                 $20
         39        DO_ICALL                                         $21     
         40        ASSIGN                                                   !5, $21
   21    41        INIT_FCALL                                               'var_dump'
         42        INIT_FCALL                                               'array_diff_uassoc'
         43        SEND_VAR                                                 !4
         44        SEND_VAR                                                 !5
         45        SEND_VAR                                                 !0
         46        DO_ICALL                                         $23     
         47        SEND_VAR                                                 $23
         48        DO_ICALL                                                 
   22    49        INIT_FCALL                                               'var_dump'
         50        SEND_VAR                                                 !1
         51        DO_ICALL                                                 
   23    52        ECHO                                                     '%0A%0A'
         53      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FlFQUm%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lFQUm
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $a, !1 = $b, !2 = $iteration_count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    6     3        PRE_INC                                                  !2
    7     4        INIT_FCALL                                               'strcmp'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
    8     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FlFQUm%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.13 ms | 1405 KiB | 25 Q