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.

Built from https://develop.svn.wordpress.org/trunk@31188


git-svn-id: http://core.svn.wordpress.org/trunk@31169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor
2015-01-16 01:06:24 +00:00
parent 6704875855
commit fe6b5983df
25 changed files with 77 additions and 69 deletions
+2 -1
View File
@@ -374,8 +374,9 @@ final class WP_Screen {
*/
public static function get( $hook_name = '' ) {
if ( is_a( $hook_name, 'WP_Screen' ) )
if ( $hook_name instanceof WP_Screen ) {
return $hook_name;
}
$post_type = $taxonomy = null;
$in_admin = false;