Skip to content
This repository was archived by the owner on Sep 20, 2021. It is now read-only.
This repository was archived by the owner on Sep 20, 2021. It is now read-only.

replace(…, '_') is considered as a callable #44

@Hywan

Description

@Hywan

Ustring::replace supports 2 forms for the second argument: Either a string, or a callable. If it is a string, then preg_replace is used, else preg_replace_callback.

The string '_' is considered as a callable, because is_callable('_') returns true. Why? Because the function _ exists!

It is a bug. It's better to test if it is a Closure.

cc @hoaproject/hoackers, any volunteers?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions