- print_r: documentation ( source)
<?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);