[php-src] Issue #20060: PATH_SEPARATOR undefined but does not throw
| From: | hakre | Date: | Sat, 04 Oct 2025 15:41:13 +0000 |
| Subject: | [php-src] Issue #20060: PATH_SEPARATOR undefined but does not throw | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-250989@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/20060
Author: hakre
### Description
The following code:
```console
cat php-cli.ini
[PHP]
include_path = .${PATH_SEPARATOR:-PATH_SEPARATOR}inc
```
Resulted in this output:
```console
../../../php-src/sapi/cli/php -c . -r 'echo ini_get("include_path"),
"\n";'
.PATH_SEPARATORinc
```
But I expected this output instead:
```
.:inc
```
Rationale: PATH_SEPARATOR constant is defined and string ":"
As it is not the case the other expectation for the output would be:
```
Fatal error: Uncaught Error: Undefined constant "PATH_SEPARATOR" in php-cli.ini:3
Stack trace:
#0 {main}
thrown in Command line code on line 1
```
Rationale: Undfined constants aren't defined with their strings in place (but even then with
notice/warning (4.3-7.1 / 7.2-7.4)) any longer but result in an error (8.0+).
* https://3v4l.org/7PA3u
```console
$ ../../../php-src/sapi/cli/php --version
PHP 8.3.27-dev (cli) (built: Oct 1 2025 21:10:57) (NTS)
```
### PHP Version
```plain
PHP 8.3.27-dev (cli) (built: Oct 1 2025 21:10:57) (NTS)
```
### Operating System
Generic Linux