[php-src] Issue #20194: Using null as an array offset is not deprecated
| From: | thomas-0816 | Date: | Thu, 16 Oct 2025 21:28:12 +0000 |
| Subject: | [php-src] Issue #20194: Using null as an array offset is not deprecated | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251077@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/20194
Author: thomas-0816
### Description
The following code:
```php
<?php
$a = [null => 1];
echo $a[null];
```
Resulted in this output:
```
Deprecated: Using null as an array offset is deprecated, use an empty string instead in
/var/www/test.php on line 5
1
```
But I expected this output instead:
```
Deprecated: Using null as an array offset is deprecated, use an empty string instead in
/var/www/test.php on line 3
Deprecated: Using null as an array offset is deprecated, use an empty string instead in
/var/www/test.php on line 5
1
```
### PHP Version
```plain
PHP 8.5.0RC2 (cli) (built: Oct 9 2025 23:32:25) (NTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.5.0RC2, Copyright (c) Zend Technologies
with Zend OPcache v8.5.0RC2, Copyright (c), by Zend Technologies
```
### Operating System
Docker php:8.5.0RC2-cli-bookworm