3v4l.org

run code in 300+ PHP versions simultaneously
<?php $all = [ '1', '2', '3', '4', ]; $new = [ '3', '2', '5', ]; $toRemove = array_diff($new, $all); $toAdd = array_intersect($all, $new); print_r($toAdd); print_r($toRemove);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4tPeq
function name:  (null)
number of ops:  19
compiled vars:  !0 = $all, !1 = $new, !2 = $toRemove, !3 = $toAdd
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   17     2        INIT_FCALL                                               'array_diff'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
   18     7        INIT_FCALL                                               'array_intersect'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !3, $8
   20    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                                 
   21    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.26 ms | 1394 KiB | 19 Q