[wp-trac] [WordPress Trac] #54877: Occasional PHP exception being thrown on WPDB/MySQLi connections
WordPress Trac
noreply at wordpress.org
Thu Jan 27 19:57:16 UTC 2022
#54877: Occasional PHP exception being thrown on WPDB/MySQLi connections
-----------------------------------+---------------------
Reporter: johnjamesjacoby | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.0
Component: Database | Version: 1.5
Severity: normal | Resolution:
Keywords: 2nd-opinion has-patch | Focuses:
-----------------------------------+---------------------
Comment (by azouamauriac):
Replying to [comment:3 johnjamesjacoby]:
> A more comprehensive change could refactor the following code, removing
the `foreach` loop & removing the only variable-variable (`$$component`)
in WordPress:
>
> {{{
> foreach ( array( 'host', 'port' ) as $component ) {
> if ( ! empty( $matches[ $component ] ) ) {
> $$component = $matches[ $component ];
> }
> }
> }}}
May be we can replace this foreach by
{{{#!php
<?php
extract($matches);
}}}
??
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54877#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list