opened
Majkl578
username_0
Enable OptimizedFunctionsWithoutUnpacking sniff
issue
created
Majkl578
username_0
Any form of unpacking kills the optimization. sprintf() is not on [the list](https://github.com/php/php-src/blob/php-7.3.0RC1/Zend/zend_compile.c#L3912-L3971) so it's not affected. Your example is a candidate for vsprintf(). :)
comment
created
lcobucci
username_1
@username_0 TIL, thanks :+1:
comment
created
Majkl578
username_0
`array_merge()` is not specially compiled function so it's not affected.
Applies only to these functions:
```php
		'array_key_exists',
		'array_slice',
		'boolval',
		'call_user_func',
		'call_user_func_array',
		'chr',
		'count',
		'doubleval',
		'defined',
		'floatval',
		'func_get_args',
		'func_num_args',
		'get_called_class',
		'get_class',
		'gettype',
		'in_array',
		'intval',
		'is_array',
		'is_bool',
		'is_double',
		'is_float',
		'is_long',
		'is_int',
		'is_integer',
		'is_null',
		'is_object',
		'is_real',
		'is_resource',
		'is_string',
		'ord',
		'strlen',
		'strval',
```
comment
created
Ocramius
username_2
That would still mean that (if it gets compiled), this rule still applies. Besides `call_user_func()`, I don't think any of these make any sense with variadic arguments
comment
created
morozov
username_3
If it gets compiled, it’ll make sense to whitelist it.
comment
created
Majkl578
username_0
Hopefully, in this case the rule will be harmless. 😊
comment
created
Ocramius
username_2
As long as the list doesn't expand without BC breaks, this is 👍
comment