[php-src] Issue #20703: PHP

[email protected] (damek24)
Newsgroups php.bugs
Message-ID <m6V0cP3WDs1jtu2qpDdQeCr5ZWIt9UeYTgnkBtHQ2rc@main.internal.php.net>
Issue: https://github.com/php/php-src/issues/20703
Author: damek24

### Description

The following code:

```php
<?php

class User {
	public ?string $id {
		get => $this->id; // get => $this->id ?? null; works
		set => $this->id = $value;
	}
}

class User2 {
    public string $id;
}

$u = new User();
$u2 = new User2();
var_dump(isset($u2->id));//false OK
var_dump(isset($u->id));//error
```

Resulted in this output:
First var_dump retuns false and this is ok, second - produces Fatal error: Uncaught Error: Typed property User::$id must not be accessed before initialization
But I expected this output instead:
false two times

This suggests that isset() on hooked properties may incorrectly trigger property access instead of checking initialization state, unlike regular typed properties.

### PHP Version

```plain
PHP 8.5.0 (cli) (built: Nov 20 2025 19:17:11) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.5.0, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.0, Copyright (c), by Zend Technologies

PHP 8.4.15 (cli) (built: Nov 20 2025 17:43:25) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.4.15, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.15, Copyright (c), by Zend Technologies
    with Xdebug v3.4.7, Copyright (c) 2002-2025, by Derick Rethans
```

### Operating System

_No response_
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.