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

Fixed usage of imported namespace. #5507

Merged
merged 1 commit into from
Nov 21, 2013
Merged

Conversation

hinikato
Copy link
Contributor

The use statement imports \ArrayObject as PhpArrayObject so we need to use it here. In other case it will use of undefined constant.

The use statement imports \ArrayObject as PhpArrayObject so we need to use it here. In other case it will use of undefined constant.
@grizzm0
Copy link
Contributor

grizzm0 commented Nov 21, 2013

Actually it uses the ArrayObject in the Zend\Stdlib namesapce which handles legacy comparability.

https://github.com/zendframework/zf2/blob/master/library/Zend/Stdlib/ArrayObject.php#L21-L25

@ghost ghost assigned Maks3w Nov 21, 2013
Maks3w added a commit that referenced this pull request Nov 21, 2013
Maks3w added a commit that referenced this pull request Nov 21, 2013
Maks3w added a commit that referenced this pull request Nov 21, 2013
@Maks3w Maks3w merged commit ebe629f into zendframework:master Nov 21, 2013
@Maks3w
Copy link
Member

Maks3w commented Nov 21, 2013

Oops. This was wrong, the code was good. ArrayObject is hacked for to have the same API along different PHP versions.

Reverting.

Maks3w added a commit that referenced this pull request Nov 21, 2013
This reverts commit 29443bd, reversing
changes made to 17779c3.
Maks3w added a commit that referenced this pull request Nov 21, 2013
This reverts commit 8753169, reversing
changes made to f976d54.
@jkavalik
Copy link

Shouldn't it be
\ArrayObject::ARRAY_AS_PROPS
then? If we want that constant from default php version of ArrayObject and not imported one?

@grizzm0
Copy link
Contributor

grizzm0 commented Nov 21, 2013

The imported one is aliases PhpArrayObject as it would conflict with the ArrayObject that already exists in the current namespace. The ArrayObject in the current namespace fixes issues between different versions of PHP.

@hinikato
Copy link
Contributor Author

Sorry it is my error, I should check the current namespace for ArrayObject first.

@hinikato
Copy link
Contributor Author

But anyway the using of PhpArrayObject::ARRAY_AS_PROPS should not break anything, it will refer to \Zend\Stdlib\ArrayObject then, right? Then fix can be right.

@Maks3w
Copy link
Member

Maks3w commented Nov 21, 2013

gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
This reverts commit 29443bdadc884ef747b37143cf95b68d993f4f9c, reversing
changes made to 17779c3c29680be0a4fa401ca355a7e9de24c6c0.
gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
This reverts commit 87531698e7ef1cf3f6994cc8b8e35eb77c9636c0, reversing
changes made to f976d54b423ca669e906a09e019ae2979ac007b4.
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.

4 participants