Skip to content

ext/standard Deprecate passing empty string to realpath()#21201

Open
arshidkv12 wants to merge 4 commits intophp:masterfrom
arshidkv12:realpath-empty
Open

ext/standard Deprecate passing empty string to realpath()#21201
arshidkv12 wants to merge 4 commits intophp:masterfrom
arshidkv12:realpath-empty

Conversation

@arshidkv12
Copy link
Contributor

@arshidkv12 arshidkv12 commented Feb 11, 2026

Deprecate passing an empty string to the realpath() php function.

Passing an empty string to realpath() currently resolves to the current working directory. This behavior is implicit and not
self-explanatory.

Deprecate this usage and emit E_DEPRECATED, recommending getcwd() instead for retrieving the current working directory.

@devnexen
Copy link
Member

Deprecate passing an empty string to the realpath() php function.

Deprecation decision needs to be discussed a little.

Passing an empty string to realpath() currently resolves to the current working directory. This behavior is implicit and not self-explanatory.

But is documented behavior.

Deprecate this usage and emit E_DEPRECATED, recommending getcwd() instead for retrieving the current working directory.

ext/standard Deprecate passing empty string to realpath()
@arshidkv12
Copy link
Contributor Author

@devnexen Okay

@iluuu1994
Copy link
Member

Seems like an unnecessary BC break, in my opinion. Especially if this is documented, people may rely on this behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants