Is it possible for object keys to be purely numeric in PHP, and what implications does this have for accessing properties?

In PHP, object keys cannot be purely numeric as they will be automatically converted to integers. This can lead to unexpected behavior when accessing properties, as the numeric key will be treated as an integer index rather than a property name. To avoid this issue, it is recommended to use strings as object keys.

class Example {
    public $data = [];

    public function __construct() {
        $this->data['123'] = 'Value';
    }
}

$example = new Example();
echo $example->data['123']; // Output: Value