Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Ensure compatibility with PHP < 5.3.9 #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mramiro
Copy link

@mramiro mramiro commented Dec 2, 2015

Prior to PHP 5.3.9 a class could not implement two interfaces if they contained a method with the same name (see first note at http://php.net/manual/en/language.oop5.interfaces.php).

The Granularity class implements both GranularityInterface and ArrayAccess and they both specify the set of offset* methods, so this results in a fatal error when running on PHP < 5.3.9 (I tested it on PHP 5.3.3). There's really no need to specify this methods in GranularityInterface, given that they're already defined in ArrayAccess.

@pableu
Copy link

pableu commented Mar 16, 2016

Yeah, please merge this PR or update the composer.json to require PHP >= 5.3.9.

@mramiro
Copy link
Author

mramiro commented Mar 29, 2016

I had forgotten this PR until now, thanks @pableu for your attention. I agree it should be merged.

I'm currently using my own branch of finediff in a project that runs on PHP 5.3.3, via composer's git capabilities, but that smells kinda hackish to me, considering there's only a single 4-line diff between it and yours. It would be nicer if I (or any other poor soul stuck with PHP 5.3.3) could just reference your package since it's already on packagist.

I checked the output of the Travis builds and one of them seems to have failed due to a network error, hence the fail notice. I can assure you the corresponding PHPUnit tests passed successfully when I ran them on my environment.

Regards.

lolli42 added a commit to lolli42/FineDiff that referenced this pull request Oct 21, 2021
GranuarityInterface is the main interface of
granularities. It should extend both \ArrayAccess
and \Countable directly and shouln't define
ArrayAccess methods like offsetExists() again.

This kinda fixes cogpowered#2
even though the PHP 5.3 problem is not an issue here anymore.
lolli42 added a commit to lolli42/FineDiff that referenced this pull request Oct 21, 2021
GranuarityInterface is the main interface of
granularities. It should extend both \ArrayAccess
and \Countable directly and shouln't define
ArrayAccess methods like offsetExists() again.

This kinda fixes cogpowered#2
even though the PHP 5.3 problem is not an issue here anymore.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants