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

SkeletonApplication with Zend Framework 2.1.1 #161

Closed
GordonSchmidt opened this issue Feb 7, 2013 · 7 comments
Closed

SkeletonApplication with Zend Framework 2.1.1 #161

GordonSchmidt opened this issue Feb 7, 2013 · 7 comments

Comments

@GordonSchmidt
Copy link

Hi,

since zf2.1.1 there seems to be an own implementation of ArrayObject which doesn't stick to the ArrayAccess-Interface (using PHP 5.3.3-7+squeeze14). This leeds to the error: "Fatal error: Declaration of Zend\Stdlib\ArrayObject::offsetGet() must be compatible with that of ArrayAccess::offsetGet() in //vendor/zendframework/zendframework/library/Zend/Stdlib/ArrayObject.php on line 25"

public function &offsetGet($key) vs. abstract public function offsetGet ($offset)

It seems to relate to this change: zendframework/zendframework#3684

I have to change "zendframework/zendframework": "2." to "zendframework/zendframework": "2.0." in the composer.json to make the ZendSkeletonApplication work on my maschine.

Does anyone know, what that's about?

Yours
Gordon

@mtcocktail
Copy link

Yes the same for me

@mtcocktail
Copy link

This problem has issue, i've modified my composer.json and it's work.

"zendframework/zendframework": "2.1.x-dev",

@brian978
Copy link

brian978 commented Feb 9, 2013

The solution posted by mtcocktail only works for applications that have the framework installed via composer in the vendor folder. If you have the framework elsewhere it won't work. The solution I found is to put the following lines:
$libDir = getenv('ZF2_PATH');
require $libDir . '/Zend/Stdlib/compatibility/autoload.php';
require $libDir . '/Zend/Session/compatibility/autoload.php';

after the include 'init_autoloader.php'; line in the index.php file

@GordonSchmidt
Copy link
Author

In my case, it was a problem in the "Zend/Stdlib/compatibility/autoload.php" and the "Zend/Session/compatibilty/autoload.php". The release-2.1.1 contains "if (version_compare(PHP_VERSION, '5.3.3', 'le')) {" instead of "if (version_compare(PHP_VERSION, '5.3.4', 'lt')) {", which excludes strangly versioned PHP 5.3.3 packages of debian and ubuntu from loading some needed classes.

It's solved in the master branch of zf2.

@misilot
Copy link

misilot commented Feb 11, 2013

@GordonSchmidt I changed thoese two files, and am still getting this error. Any idea what else to check? Thanks!

@GordonSchmidt
Copy link
Author

@misilot you're sure, you are getting the same error?
instead of patching release-2.1.1 you could use the master branch (with composer use "2.@dev" instead of "2."). The version_compare's are fixed there.

@asmitamahamuni
Copy link

Hii,

I am also getting following error,

Fatal error: Declaration of Zend\Stdlib\ArrayObject::offsetGet() must be compatible with that of ArrayAccess::offsetGet() in /var/www/vendor/zendframework/zendframework/library/Zend/Stdlib/ArrayObject.php on line 25.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants