Bug report
for some reason we have a false positive in the preg_replace_callback callback
Code snippet that reproduces the problem
https://phpstan.org/r/c3d20778-d776-462f-b544-c98fed1333a0
same problem in array-function style callback: https://phpstan.org/r/afe20725-1ad2-4a7d-8043-ed517d3499d8
Expected output
no error regarding anonymous function return type. in the context of preg_replace_callback we cannot infer which constant return type this callback should have.
Did PHPStan help you today? Did it make you happy in any way?
No response
Bug report
for some reason we have a false positive in the
preg_replace_callbackcallbackCode snippet that reproduces the problem
https://phpstan.org/r/c3d20778-d776-462f-b544-c98fed1333a0
same problem in array-function style callback: https://phpstan.org/r/afe20725-1ad2-4a7d-8043-ed517d3499d8
Expected output
no error regarding anonymous function return type. in the context of
preg_replace_callbackwe cannot infer which constant return type this callback should have.Did PHPStan help you today? Did it make you happy in any way?
No response