- Output for 8.1.19 - 8.1.31, 8.2.11 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
- Array ( [foo] => bar ) Array ( [foo] => bar [properties] => created ) Array ( [properties] => created )
<?php
// No properties key.
$schema = ['foo' => 'bar'];
if (($schema['properties'] ?? NULL) === []) {
$schema['properties'] = 'created';
}
print_r($schema);
if (($schema['properties'] ?? []) === []) {
$schema['properties'] = 'created';
}
print_r($schema);
// Empty properties key.
$schema = ['properties' => []];
if (($schema['properties'] ?? []) === []) {
$schema['properties'] = 'created';
}
print_r($schema);