DDC-3056: Return value mismatch between code under HHVM and Zend #3793

Closed
opened 2026-01-22 14:28:08 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (Mar 28, 2014).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user andybursh:

The following code produces differing results under Zend and HHVM runtimes.

// $all::build uses the query builder to select all entities of a type
/*** @var \Doctrine\ORM\Query $query ***/
$query = $all->build($qb);
$query->setMaxResults($pageSize)->setFirstResult($start);

$paginator = new Paginator($query);
$results = array_values((array)$paginator->getIterator());

Under Zend, $results is a 1-dimensional array containing N elements:
[1, 2, 3].

Under HHVM, $results is a 2-dimensional array containing a single array, containing N elements:
[ [1,3,3] ]

Originally created by @doctrinebot on GitHub (Mar 28, 2014). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user andybursh: The following code produces differing results under Zend and HHVM runtimes. ``` // $all::build uses the query builder to select all entities of a type /*** @var \Doctrine\ORM\Query $query ***/ $query = $all->build($qb); $query->setMaxResults($pageSize)->setFirstResult($start); $paginator = new Paginator($query); $results = array_values((array)$paginator->getIterator()); ``` Under Zend, `$results` is a 1-dimensional array containing N elements: `[1, 2, 3]`. Under HHVM, `$results` is a 2-dimensional array containing a single array, containing N elements: `[ [1,3,3] ]`
admin added the Bug label 2026-01-22 14:28:08 +01:00
admin closed this issue 2026-01-22 14:28:08 +01:00
Author
Owner

@doctrinebot commented on GitHub (Mar 28, 2014):

Comment created by stof:

I suggest reporting it to the HHVM team as a bug

@doctrinebot commented on GitHub (Mar 28, 2014): Comment created by stof: I suggest reporting it to the HHVM team as a bug
Author
Owner

@doctrinebot commented on GitHub (Mar 28, 2014):

Comment created by @ocramius:

Also: why are you using an array cast and not iterator*to*array?

@doctrinebot commented on GitHub (Mar 28, 2014): Comment created by @ocramius: Also: why are you using an array cast and not `iterator*to*array`?
Author
Owner

@doctrinebot commented on GitHub (Mar 28, 2014):

Comment created by stof:

@Marco this should be equivalent. Casting a Traversable to array should traverse it. If HHVM does not do it, it is a bug.

@doctrinebot commented on GitHub (Mar 28, 2014): Comment created by stof: @Marco this should be equivalent. Casting a Traversable to array should traverse it. If HHVM does not do it, it is a bug.
Author
Owner

@doctrinebot commented on GitHub (Mar 28, 2014):

Comment created by @ocramius:

[~stof] not really: http://3v4l.org/Z3t4t

@doctrinebot commented on GitHub (Mar 28, 2014): Comment created by @ocramius: [~stof] not really: http://3v4l.org/Z3t4t
Author
Owner

@doctrinebot commented on GitHub (Aug 18, 2014):

Comment created by @ocramius:

Resolving as invalid: this seems to be a misuse in my opinion.

@doctrinebot commented on GitHub (Aug 18, 2014): Comment created by @ocramius: Resolving as invalid: this seems to be a misuse in my opinion.
Author
Owner

@doctrinebot commented on GitHub (Aug 18, 2014):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Aug 18, 2014): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3793