3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array1 = ["a" => "green", "b" => "brown", "c" => "blue", 0 => "red"]; $array2 = ["a" => "GREEN", "B" => "brown", 0 => "yellow", 1 => "red", "c" => "blue"]; var_export( array_uintersect_assoc( $array1, $array2, function ($a, $b) { //var_export([$a, $b, str_contains($a, $b), (bool)str_contains($a, $b), (int)(bool)str_contains($a, $b)]); //echo "\n"; return str_contains($a, $b); } ) ); echo "\n---\n"; var_export( array_udiff_assoc( $array1, $array2, function ($a, $b) { //var_export([$a, $b, str_contains($a, $b), (bool)str_contains($a, $b), (int)(bool)str_contains($a, $b)]); //echo "\n"; return str_contains($a, $b); } ) ); echo "\n---\n"; var_export( array_uintersect_assoc( $array1, $array2, function ($a, $b) { return str_contains($a, $b) ? 0 : 1; } ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rt4Jq
function name:  (null)
number of ops:  32
compiled vars:  !0 = $array1, !1 = $array2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
    6     2        INIT_FCALL                                                   'var_export'
    7     3        INIT_FCALL                                                   'array_uintersect_assoc'
    8     4        SEND_VAR                                                     !0
    9     5        SEND_VAR                                                     !1
   10     6        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
   14     7        SEND_VAL                                                     ~4
    7     8        DO_ICALL                                             $5      
   14     9        SEND_VAR                                                     $5
    6    10        DO_ICALL                                                     
   18    11        ECHO                                                         '%0A---%0A'
   20    12        INIT_FCALL                                                   'var_export'
   21    13        INIT_FCALL                                                   'array_udiff_assoc'
   22    14        SEND_VAR                                                     !0
   23    15        SEND_VAR                                                     !1
   24    16        DECLARE_LAMBDA_FUNCTION                              ~7      [1]
   28    17        SEND_VAL                                                     ~7
   21    18        DO_ICALL                                             $8      
   28    19        SEND_VAR                                                     $8
   20    20        DO_ICALL                                                     
   32    21        ECHO                                                         '%0A---%0A'
   34    22        INIT_FCALL                                                   'var_export'
   35    23        INIT_FCALL                                                   'array_uintersect_assoc'
   36    24        SEND_VAR                                                     !0
   37    25        SEND_VAR                                                     !1
   38    26        DECLARE_LAMBDA_FUNCTION                              ~10     [2]
   40    27        SEND_VAL                                                     ~10
   35    28        DO_ICALL                                             $11     
   40    29        SEND_VAR                                                     $11
   34    30        DO_ICALL                                                     
   42    31      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rt4Jq
function name:  {closure:/in/Rt4Jq:10}
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   13     2        FRAMELESS_ICALL_2                str_contains        ~2      !0, !1
          3      > RETURN                                                       ~2
   14     4*     > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rt4Jq
function name:  {closure:/in/Rt4Jq:24}
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   27     2        FRAMELESS_ICALL_2                str_contains        ~2      !0, !1
          3      > RETURN                                                       ~2
   28     4*     > RETURN                                                       null

End of Dynamic Function 1

Dynamic Function 2
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/Rt4Jq
function name:  {closure:/in/Rt4Jq:38}
number of ops:  9
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   38     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   39     2        FRAMELESS_ICALL_2                str_contains        ~2      !0, !1
          3      > JMPZ                                                         ~2, ->6
          4    >   QM_ASSIGN                                            ~3      0
          5      > JMP                                                          ->7
          6    >   QM_ASSIGN                                            ~3      1
          7    > > RETURN                                                       ~3
   40     8*     > RETURN                                                       null

End of Dynamic Function 2

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.97 ms | 1888 KiB | 16 Q