Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix Strict errors shown by removing deprecated is_a() #169

Merged
merged 1 commit into from Jan 15, 2012

Conversation

Projects
None yet
2 participants
Contributor

davidkuridza commented Jan 11, 2012

Function is_a() became deprecated with PHP 5.0.0 resulting in an E_STRICT
warning. Function is no longer deprecated with PHP 5.3.0, however, using any
version between 5.0.0 and 5.2.x and E_DEPRECATED enabled, Strict standards
notice is shown. This fix refactors all is_a() occurrences using instanceof
operator. For example,

if (is_a($this, 'SimplePie'))

becomes

if ($this instanceof SimplePie)

@davidkuridza davidkuridza Replace deprecated `is_a()` with `instanceof`
Function `is_a()` became deprecated with PHP 5.0.0 resulting in an `E_STRICT`
warning. Function is no longer deprecated with PHP 5.3.0, however, using any
version between 5.0.0 and 5.2.x and `E_DEPRECATED` enabled, `Strict standards`
notice is shown. This fix refactors all `is_a()` occurrences using `instanceof`
operator. For example,

  `if (is_a($this, 'SimplePie'))`

becomes

  `if ($this instanceof SimplePie)`
b56b7dd
Contributor

rmccue commented Jan 15, 2012

is_a became deprecated in 5.0.0, but was undeprecated in 5.3.0. Personally, I don't see any reason to drop using is_a apart from an E_DEPRECATED that no longer exists.

I'm happy to be convinced though.

Contributor

davidkuridza commented Jan 15, 2012

According to requirements, PHP 5.1.4 or newer is required, meaning everyone who still needs to support PHP versions between 5.1.4 and 5.2.x, will see the errors popping out in development and testing environment. The problem happens when later on in the script something needs to be done with headers for example, since an output already happened, this script will most likely die. Not to mention the front-end output cluttered with notices.

Also, I for one really like to have clean flow, seeing bunch of errors raised gives me the chills :)

Contributor

rmccue commented Jan 15, 2012

Fair enough. Merging now...

@rmccue rmccue added a commit that referenced this pull request Jan 15, 2012

@rmccue rmccue Merge pull request #169 from davidkuridza/master
Fix strict errors shown by removing deprecated is_a()
fd4e21a

@rmccue rmccue merged commit fd4e21a into simplepie:master Jan 15, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment