3v4l.org

run code in 300+ PHP versions simultaneously
<?php $externalProducts = json_decode('{ "Filter": { "Title": "All Products" }, "Products": [{ "Type": "Jacket", "Price": 75, "ExpiryDate": "2018-06-30", "StockNumber": "180220/003", "Created": "2018-02-20 12:24:06", "Modified": "2018-05-30 02:00:23" }, { "Type": "Jeans", "Price": 150, "ExpiryDate": "2018-06-30", "StockNumber": "180221/004", "Created": "2017-08-10 15:11:44", "Modified": "2018-05-30 02:00:22" }, { "Type": "Jacket", "Price": 240, "ExpiryDate": "2018-06-30", "StockNumber": "150804/012", "Created": "2015-08-04 17:03:42", "Modified": "2018-05-30 02:00:22" } ] }',true); $internalProducts = json_decode('"localProducts": [{ "title": "Fur Coat", "id": 16526, "created_at": "2018-05-17T10:15:45Z", "updated_at": "2018-05-17T10:15:45Z", "sku": "180514/001", "price": "75.00", "regular_price": "75.00", "categories": [ "Jackets", ], }, { "title": "Ripped Jeans", "id": 16527, "created_at": "2018-05-17T10:15:45Z", "updated_at": "2018-05-17T10:15:45Z", "sku": "180221/004", "price": "150.00", "regular_price": "150.00", "categories": [ "Jeans", ], }, { "title": "Leather Jacket", "id": 16528, "created_at": "2018-05-17T10:15:45Z", "updated_at": "2018-05-17T10:15:45Z", "sku": "150804/012", "price": "240.00", "regular_price": "240.00", "categories": [ "Jackets", ], } ]',true); $extstock = array_column($externalProducts, "StockNumber"); $intsku = array_column($internalProducts, "sku"); var_dump(array_diff($extstock, $intsku));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/513Ev
function name:  (null)
number of ops:  28
compiled vars:  !0 = $externalProducts, !1 = $internalProducts, !2 = $extstock, !3 = $intsku
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%0A%22Filter%22%3A+%7B%0A++++%22Title%22%3A+%22All+Products%22%0A%7D%2C%0A%22Products%22%3A+%5B%7B%0A++++++++%22Type%22%3A+%22Jacket%22%2C%0A++++++++%22Price%22%3A+75%2C%0A++++++++%22ExpiryDate%22%3A+%222018-06-30%22%2C%0A++++++++%22StockNumber%22%3A+%22180220%2F003%22%2C%0A++++++++%22Created%22%3A+%222018-02-20+12%3A24%3A06%22%2C%0A++++++++%22Modified%22%3A+%222018-05-30+02%3A00%3A23%22%0A++++%7D%2C%0A++++%7B%0A++++++++%22Type%22%3A+%22Jeans%22%2C%0A++++++++%22Price%22%3A+150%2C%0A++++++++%22ExpiryDate%22%3A+%222018-06-30%22%2C%0A++++++++%22StockNumber%22%3A+%22180221%2F004%22%2C%0A++++++++%22Created%22%3A+%222017-08-10+15%3A11%3A44%22%2C%0A++++++++%22Modified%22%3A+%222018-05-30+02%3A00%3A22%22%0A++++%7D%2C%0A++++%7B%0A++++++++%22Type%22%3A+%22Jacket%22%2C%0A++++++++%22Price%22%3A+240%2C%0A++++++++%22ExpiryDate%22%3A+%222018-06-30%22%2C%0A++++++++%22StockNumber%22%3A+%22150804%2F012%22%2C%0A++++++++%22Created%22%3A+%222015-08-04+17%3A03%3A42%22%2C%0A++++++++%22Modified%22%3A+%222018-05-30+02%3A00%3A22%22%0A++++%7D%0A++++%5D%0A%7D'
   32     2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $4      
    3     4        ASSIGN                                                   !0, $4
   33     5        INIT_FCALL                                               'json_decode'
          6        SEND_VAL                                                 '%22localProducts%22%3A+%5B%7B%0A++++%22title%22%3A+%22Fur+Coat%22%2C%0A++++%22id%22%3A+16526%2C%0A++++%22created_at%22%3A+%222018-05-17T10%3A15%3A45Z%22%2C%0A++++%22updated_at%22%3A+%222018-05-17T10%3A15%3A45Z%22%2C%0A++++%22sku%22%3A+%22180514%2F001%22%2C%0A++++%22price%22%3A+%2275.00%22%2C%0A++++%22regular_price%22%3A+%2275.00%22%2C%0A++++%22categories%22%3A+%5B%0A++++++++%22Jackets%22%2C%0A++++%5D%2C%0A%7D%2C%0A%7B%0A++++%22title%22%3A+%22Ripped+Jeans%22%2C%0A++++%22id%22%3A+16527%2C%0A++++%22created_at%22%3A+%222018-05-17T10%3A15%3A45Z%22%2C%0A++++%22updated_at%22%3A+%222018-05-17T10%3A15%3A45Z%22%2C%0A++++%22sku%22%3A+%22180221%2F004%22%2C%0A++++%22price%22%3A+%22150.00%22%2C%0A++++%22regular_price%22%3A+%22150.00%22%2C%0A++++%22categories%22%3A+%5B%0A++++++++%22Jeans%22%2C%0A++++%5D%2C%0A%7D%2C%0A%7B%0A++++%22title%22%3A+%22Leather+Jacket%22%2C%0A++++%22id%22%3A+16528%2C%0A++++%22created_at%22%3A+%222018-05-17T10%3A15%3A45Z%22%2C%0A++++%22updated_at%22%3A+%222018-05-17T10%3A15%3A45Z%22%2C%0A++++%22sku%22%3A+%22150804%2F012%22%2C%0A++++%22price%22%3A+%22240.00%22%2C%0A++++%22regular_price%22%3A+%22240.00%22%2C%0A++++%22categories%22%3A+%5B%0A++++++++%22Jackets%22%2C%0A++++%5D%2C%0A++++%7D%0A%5D'
   69     7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $6      
   33     9        ASSIGN                                                   !1, $6
   72    10        INIT_FCALL                                               'array_column'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 'StockNumber'
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !2, $8
   73    15        INIT_FCALL                                               'array_column'
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 'sku'
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !3, $10
   75    20        INIT_FCALL                                               'var_dump'
         21        INIT_FCALL                                               'array_diff'
         22        SEND_VAR                                                 !2
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                         $12     
         25        SEND_VAR                                                 $12
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.64 ms | 1405 KiB | 21 Q