<?php
$pageids = [
['id' => 1, 'linklabel' => 'Home', 'url' => 'home'],
['id' => 2, 'linklabel' => 'Graphic Design', 'url' => 'graphicdesign'],
['id' => 3, 'linklabel' => 'Other Design', 'url' => 'otherdesign'],
['id' => 6, 'linklabel' => 'Logo Design', 'url' => 'logodesign'],
['id' => 15, 'linklabel' => 'Content Writing', 'url' => 'contentwriting'],
];
$parentpage = [
['id' => 2, 'linklabel' => 'Graphic Design', 'url' => 'graphicdesign'],
['url' => 'otherdesign', 'id' => 3, 'linklabel' => 'Other Design'],
];
var_export(
array_udiff($pageids, $parentpage, fn($a, $b) => $a <=> $b)
);
- Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
- array (
0 =>
array (
'id' => 1,
'linklabel' => 'Home',
'url' => 'home',
),
3 =>
array (
'id' => 6,
'linklabel' => 'Logo Design',
'url' => 'logodesign',
),
4 =>
array (
'id' => 15,
'linklabel' => 'Content Writing',
'url' => 'contentwriting',
),
)
- Output for 7.1.33, 7.2.34
- Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')' in /in/U9bcn on line 17
Process exited with code 255.
preferences:
90.7 ms | 407 KiB | 5 Q