hybridauth icon indicating copy to clipboard operation
hybridauth copied to clipboard

Replace older-style PHP type conversion functions with type casts

Open champsupertramp opened this issue 3 years ago • 2 comments

I'm using hybridauth as a library for a WordPress plugin. WordPress is now using direct type casting: https://make.wordpress.org/core/2020/11/20/miscellaneous-developer-focused-changes-in-wordpress-5-6/

In PHP 5 and later direct type casting is available, which is often many times more performant than their function predecessors.

Is this something that HybridAuth should be using?

Thanks

champsupertramp avatar Nov 25 '20 05:11 champsupertramp

Hello, thanks for recommendation. It makes sense for sure.

So, plan is to replace the following usages:

intval() → (int)
strval() → (string)
floatval() → (float)

ApacheEx avatar Mar 17 '21 07:03 ApacheEx

Micro optimizations really only make sense for code in the critical path (i.e. called a LOT during a single request), and I would very much doubt that hybridauth code is in the critical path.

chrisgraham avatar Oct 30 '21 01:10 chrisgraham