-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Named Arguments #324
Comments
Which PHP version and which safe version are you using? |
Both latest: echo PHP_VERSION_ID, PHP_EOL,
json_decode(file_get_contents(__DIR__. '/composer.lock'))->packages[0]->name, PHP_EOL,
json_decode(file_get_contents(__DIR__. '/composer.lock'))->packages[0]->version, PHP_EOL,
var_export((new \ReflectionFunction('Safe\json_decode'))->getParameters(), true), PHP_EOL,
var_export((new \ReflectionFunction('\json_decode'))->getParameters(), true); 80102
thecodingmachine/safe
v2.1.1
array (
0 =>
ReflectionParameter::__set_state(array(
'name' => 'json',
)),
1 =>
ReflectionParameter::__set_state(array(
'name' => 'assoc',
)),
2 =>
ReflectionParameter::__set_state(array(
'name' => 'depth',
)),
3 =>
ReflectionParameter::__set_state(array(
'name' => 'options',
)),
)
array (
0 =>
ReflectionParameter::__set_state(array(
'name' => 'json',
)),
1 =>
ReflectionParameter::__set_state(array(
'name' => 'associative',
)),
2 =>
ReflectionParameter::__set_state(array(
'name' => 'depth',
)),
3 =>
ReflectionParameter::__set_state(array(
'name' => 'flags',
)),
) |
Ah this is a bug then. Since If you are up for it, you can submit a PR changing the parameter names in https://github.com/thecodingmachine/safe/blob/master/lib/special_cases.php |
@dbrekelmans Hi! Consider my changes, please. #376 |
Fixed in #376 |
Is breaking straightforward migration when named arguments are used a bug or feature?
E.g. this code - without Safe - will work fine:
migration to using Safe would require to changing
flags
tooptions
though.The text was updated successfully, but these errors were encountered: