3v4l.org

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

Function compare:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s8aVL
function name:  compare
number of ops:  9
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        IS_EQUAL                                                 !0, !1
          3      > JMPZ                                                     ~2, ->6
          4    >   QM_ASSIGN                                        ~3      0
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~3      1
          7    > > RETURN                                                   ~3
    8     8*     > RETURN                                                   null

End of function compare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.43 ms | 1405 KiB | 23 Q