3v4l.org

run code in 300+ PHP versions simultaneously
<?php function key_compare_func($a, $b) { print "$a - $b\n"; $a = "|$a"; $b = "|$b"; if ($a == $b) { return 0; } return $a < $b ? -1 : 1; } $array1 = array("a" => "green", "b" => "Brown", "c" => "blue", 0 => "red"); $array2 = array(0 => "red", "a" => "green", "b" => "Brown", "c" => "blue"); $result = array_diff_uassoc($array1, $array2, "key_compare_func"); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gJiu4
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array1, !1 = $array2, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, <array>
   17     2        INIT_FCALL                                               'array_diff_uassoc'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 'key_compare_func'
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !2, $5
   18     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function key_compare_func:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gJiu4
function name:  key_compare_func
number of ops:  23
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ROPE_INIT                                     4  ~3      !0
          3        ROPE_ADD                                      1  ~3      ~3, '+-+'
          4        ROPE_ADD                                      2  ~3      ~3, !1
          5        ROPE_END                                      3  ~2      ~3, '%0A'
          6        ECHO                                                     ~2
    6     7        NOP                                                      
          8        FAST_CONCAT                                      ~5      '%7C', !0
          9        ASSIGN                                                   !0, ~5
    7    10        NOP                                                      
         11        FAST_CONCAT                                      ~7      '%7C', !1
         12        ASSIGN                                                   !1, ~7
    8    13        IS_EQUAL                                                 !0, !1
         14      > JMPZ                                                     ~9, ->16
    9    15    > > RETURN                                                   0
   11    16    >   IS_SMALLER                                               !0, !1
         17      > JMPZ                                                     ~10, ->20
         18    >   QM_ASSIGN                                        ~11     -1
         19      > JMP                                                      ->21
         20    >   QM_ASSIGN                                        ~11     1
         21    > > RETURN                                                   ~11
   12    22*     > RETURN                                                   null

End of function key_compare_func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.09 ms | 1405 KiB | 17 Q