Skip to content

Loading…

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

Closed
doctrinebot opened this Issue · 6 comments

2 participants

@doctrinebot

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] ]

@doctrinebot

Comment created by stof:

I suggest reporting it to the HHVM team as a bug

@doctrinebot

Comment created by @ocramius:

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

@doctrinebot

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

Comment created by @ocramius:

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

@doctrinebot

Comment created by @ocramius:

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

@doctrinebot

Issue was closed with resolution "Invalid"

@Ocramius Ocramius was assigned by doctrinebot
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.