3v4l.org

run code in 300+ PHP versions simultaneously
<?php // This is your updated data arrays $arry1 and $arry2 // Case1: introduce a dummy element with value "C" into $arry2 $arry1 = array( "lineCode" => "B", "serviceRequest" => "", "skillCode" => "15", "opCode" => "15", "jobType" => "CUSTOMER", "techNo" => "A05", "lineStatus" => "C" ); $arry2 = array( "dummy" => "C", // with this dummy element you will get an empty array back from array_diff() "id" => "755362", "rid" => "252184", "lineCode" => "B", "serviceRequest" => "", "skillCode" => "15", "opCode" => "15", "jobType" => "CUSTOMER", "techNo" => "A05", "lineStatus" => "W", "timeA" => "1575504138", "timeC" => "0", ); $diff = array_diff($arry1, $arry2); print_r($diff); // Case 2: delete the dummy entry, i.e. array_diff() now finds 1 value in $arry1 that is not present in $arry2 - "C" $arry1 = array( "lineCode" => "B", "serviceRequest" => "", "skillCode" => "15", "opCode" => "15", "jobType" => "CUSTOMER", "techNo" => "A05", "lineStatus" => "C" ); $arry2 = array( // deleted dummy entry "id" => "755362", "rid" => "252184", "lineCode" => "B", "serviceRequest" => "", "skillCode" => "15", "opCode" => "15", "jobType" => "CUSTOMER", "techNo" => "A05", "lineStatus" => "W", "timeA" => "1575504138", "timeC" => "0", ); $diff = array_diff($arry1, $arry2); print_r($diff);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qoN2t
function name:  (null)
number of ops:  21
compiled vars:  !0 = $arry1, !1 = $arry2, !2 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, <array>
   30     2        INIT_FCALL                                               'array_diff'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
   31     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
   35    10        ASSIGN                                                   !0, <array>
   45    11        ASSIGN                                                   !1, <array>
   60    12        INIT_FCALL                                               'array_diff'
         13        SEND_VAR                                                 !0
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $10     
         16        ASSIGN                                                   !2, $10
   61    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
227.04 ms | 1011 KiB | 15 Q