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); var_dump($internalProducts); $extstock = array_column($externalProducts, "StockNumber"); $intsku = array_column($internalProducts, "sku"); var_dump(array_diff($extstock, $intsku));
Output for git.master_jit, git.master, rfc.property-hooks
NULL Fatal error: Uncaught TypeError: array_column(): Argument #1 ($array) must be of type array, null given in /in/bl744:73 Stack trace: #0 /in/bl744(73): array_column(NULL, 'sku') #1 {main} thrown in /in/bl744 on line 73
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
60.02 ms | 401 KiB | 8 Q