coding-standard icon indicating copy to clipboard operation
coding-standard copied to clipboard

sprintf() is now optimized by the compiler

Open arokettu opened this issue 1 year ago • 2 comments

See: https://github.com/php/php-src/pull/14546

Therefore is should be added to FunctionHelper::SPECIAL_FUNCTIONS

arokettu avatar Sep 25 '24 16:09 arokettu

has sprintf's function signature changed? Is it now a language construct (like empty()) vs a function?

what makes it "special" ?

bkdotcom avatar Oct 02 '24 20:10 bkdotcom

@bkdotcom FunctionHelper::SPECIAL_FUNCTIONS is used by SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions to indicate functions that can be optimized by compiler when fully qualified, at least that's what the code tells me

arokettu avatar Oct 04 '24 10:10 arokettu

Implemented in https://github.com/slevomat/coding-standard/commit/dd05cd6da4b789de52c60741e353ce4df3d36a2c

kukulich avatar Feb 01 '25 12:02 kukulich

Thanks!

arokettu avatar Feb 03 '25 14:02 arokettu