This repository has been archived by the owner on Sep 20, 2021. It is now read-only.
replace(…, '_')
is considered as a callable
#44
Labels
replace(…, '_')
is considered as a callable
#44
Ustring::replace
supports 2 forms for the second argument: Either a string, or a callable. If it is a string, thenpreg_replace
is used, elsepreg_replace_callback
.The string
'_'
is considered as a callable, becauseis_callable('_')
returnstrue
. Why? Because the function_
exists!It is a bug. It's better to test if it is a
Closure
.cc @hoaproject/hoackers, any volunteers?
The text was updated successfully, but these errors were encountered: