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('a', 'b', 'c', 'n'); $b = array('m', 'x', 'y', 'z'); $iteration_count = 0; echo "array_udiff:" . json_encode(array_udiff($a, $b, $compare)) . "\n"; echo "iterations: $iteration_count\n\n"; $iteration_count = 0; echo "array_uintersect:" . json_encode(array_uintersect($a, $b, $compare)) . "\n"; echo "iterations: $iteration_count\n\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pv2MX
function name:  (null)
number of ops:  38
compiled vars:  !0 = $compare, !1 = $iteration_count, !2 = $a, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fpv2MX%3A3%240'
          1        BIND_LEXICAL                                             ~4, !1
          2        ASSIGN                                                   !0, ~4
   10     3        ASSIGN                                                   !2, <array>
   11     4        ASSIGN                                                   !3, <array>
   13     5        ASSIGN                                                   !1, 0
   14     6        INIT_FCALL                                               'json_encode'
          7        INIT_FCALL                                               'array_udiff'
          8        SEND_VAR                                                 !2
          9        SEND_VAR                                                 !3
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $9      
         12        SEND_VAR                                                 $9
         13        DO_ICALL                                         $10     
         14        CONCAT                                           ~11     'array_udiff%3A', $10
         15        CONCAT                                           ~12     ~11, '%0A'
         16        ECHO                                                     ~12
   15    17        ROPE_INIT                                     3  ~14     'iterations%3A+'
         18        ROPE_ADD                                      1  ~14     ~14, !1
         19        ROPE_END                                      2  ~13     ~14, '%0A%0A'
         20        ECHO                                                     ~13
   17    21        ASSIGN                                                   !1, 0
   18    22        INIT_FCALL                                               'json_encode'
         23        INIT_FCALL                                               'array_uintersect'
         24        SEND_VAR                                                 !2
         25        SEND_VAR                                                 !3
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $17     
         28        SEND_VAR                                                 $17
         29        DO_ICALL                                         $18     
         30        CONCAT                                           ~19     'array_uintersect%3A', $18
         31        CONCAT                                           ~20     ~19, '%0A'
         32        ECHO                                                     ~20
   19    33        ROPE_INIT                                     3  ~22     'iterations%3A+'
         34        ROPE_ADD                                      1  ~22     ~22, !1
         35        ROPE_END                                      2  ~21     ~22, '%0A%0A'
         36        ECHO                                                     ~21
         37      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fpv2MX%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pv2MX
function name:  {closure}
number of ops:  15
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
    5     3        ROPE_INIT                                     4  ~4      !0
          4        ROPE_ADD                                      1  ~4      ~4, '+%3A+'
          5        ROPE_ADD                                      2  ~4      ~4, !1
          6        ROPE_END                                      3  ~3      ~4, '%0A'
          7        ECHO                                                     ~3
    6     8        PRE_INC                                                  !2
    7     9        INIT_FCALL                                               'strcmp'
         10        SEND_VAR                                                 !0
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $7      
         13      > RETURN                                                   $7
    8    14*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.78 ms | 1405 KiB | 21 Q