[wp-trac] [WordPress Trac] #25672: is_a() causing errors with get_users()

WordPress Trac noreply at wordpress.org
Fri Jan 16 01:05:54 UTC 2015


#25672: is_a() causing errors with get_users()
---------------------------------+-----------------------------
 Reporter:  dgdax                |       Owner:  wonderboymusic
     Type:  defect (bug)         |      Status:  closed
 Priority:  normal               |   Milestone:  4.2
Component:  General              |     Version:  3.6.1
 Severity:  normal               |  Resolution:  fixed
 Keywords:  has-patch 4.2-early  |     Focuses:
---------------------------------+-----------------------------
Changes (by wonderboymusic):

 * owner:   => wonderboymusic
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"31188"]:
 {{{
 #!CommitTicketReference repository="" revision="31188"
 In PHP 5.0.0, `is_a()` became deprecated in favour of the `instanceof`
 operator. Calling `is_a()` would result in an `E_STRICT` warning.

 In PHP 5.3.0, `is_a()` is no longer deprecated, and will therefore no
 longer throw `E_STRICT` warnings.

 To avoid warnings in PHP < 5.3.0, convert all `is_a()` calls to `$var
 instanceof WP_Class` calls.

 `instanceof` does not throw any error if the variable being tested is not
 an object, it simply returns `false`.

 Props markoheijnen, wonderboymusic.
 Fixes #25672.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/25672#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list