[wp-trac] [WordPress Trac] #5424: wpdb: use function_exists() instead of slower version_compare()

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 6 05:27:55 GMT 2007


#5424: wpdb: use function_exists() instead of slower version_compare()
--------------------------+-------------------------------------------------
 Reporter:  DD32          |       Owner:  anonymous
     Type:  defect        |      Status:  new      
 Priority:  normal        |   Milestone:  2.4      
Component:  Optimization  |     Version:  2.4      
 Severity:  normal        |    Keywords:  has-patch
--------------------------+-------------------------------------------------
 Wpdb's escaping code currently compares the PHP version to determine if a
 function will be available or not.

 {{{ function_exists('mysql_real_escape_string'); }}}

 is about twice as fast as the current code(on testing of 1,000
 iterations):

 {{{ version_compare( phpversion(), '4.3.0' ); }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5424>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list