3v4l.org

run code in 300+ PHP versions simultaneously
<?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);

preferences:
23.75 ms | 404 KiB | 5 Q