3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['occurence' => 17, 'word' => 'sampleword'], ['occurence' => 14, 'word' => 'sampleword1'], ['occurence' => 14, 'word' => 'sampleword2'], ['occurence' => 14, 'word' => 'sampleword3'], ]; $forbidden_words = [ 'sampleword1', 'sampleword3' ]; var_export( array_udiff( $array, $forbidden_words, fn($a, $b) => ($a['word'] ?? $a) <=> ($b['word'] ?? $b) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pUPbK
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array, !1 = $forbidden_words
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   16     2        INIT_FCALL                                               'var_export'
   17     3        INIT_FCALL                                               'array_udiff'
   18     4        SEND_VAR                                                 !0
   19     5        SEND_VAR                                                 !1
   20     6        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
   24     7        SEND_VAL                                                 ~4
   17     8        DO_ICALL                                         $5      
   24     9        SEND_VAR                                                 $5
   16    10        DO_ICALL                                                 
   25    11      > 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/pUPbK
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   21     2        FETCH_DIM_IS                                     ~2      !0, 'word'
          3        COALESCE                                         ~3      ~2
          4        QM_ASSIGN                                        ~3      !0
   23     5        FETCH_DIM_IS                                     ~4      !1, 'word'
          6        COALESCE                                         ~5      ~4
          7        QM_ASSIGN                                        ~5      !1
          8        SPACESHIP                                        ~6      ~3, ~5
          9      > RETURN                                                   ~6
   24    10*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.92 ms | 999 KiB | 15 Q