[wp-trac] [WordPress Trac] #42918: Replace intval(), strval(), ... function calls with type hints

WordPress Trac noreply at wordpress.org
Sat Dec 16 21:44:55 UTC 2017


#42918: Replace intval(), strval(), ... function calls with type hints
-------------------------+-----------------------------
 Reporter:  ayeshrajans  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 PHP's `intval()`, `strval()`, `floatval()` and `boolval()` are from PHP 4
 ages. PHP 5 and later has the type hinting pattern (e.g `(int) $var`) that
 is ~6x faster than their function-call counterpart.

 There are over 250 such calls, and I'll upload a patch to replace them
 with type hints. The patch itself is large, but because `intval()` and
 `(int)` are identical in usage, I hope you can review it. The test suit
 passed (https://travis-ci.org/Ayesh/wordpress-develop/builds/317469175).


 I have not changed anything in third party libraries (such as
 random_compat).

 Thank you.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42918>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list