Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

behaviour diff: RecursiveArrayIterator #766

Closed
karpa13a opened this issue May 14, 2013 · 4 comments
Closed

behaviour diff: RecursiveArrayIterator #766

karpa13a opened this issue May 14, 2013 · 4 comments
Assignees

Comments

@karpa13a
Copy link

following code produces error:

karp@karp:~/tmp/php/1$ php -v
PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli) (built: Mar 11 2013 14:31:48) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
karp@karp:~/tmp/php/1$ hhvm --version
HipHop VM v2.0.2 (rel)
Compiler: tags/HPHP-2.0.2-0-ga3803ffa8aab6dd582af9f6e28bb8878954310dd
Repo schema: c9334168ca1d6fbba2f465f1bdf1e96e0e53b0cf
karp@karp:~/tmp/php/1$ cat recursiveiteratoriterator-getdepth.php 
<?php
$tree = array();
$tree[1][2][3] = 'lemon';
$tree[1][4] = 'melon';
$tree[2][3] = 'orange';
$tree[2][5] = 'grape';
$tree[3] = 'pineapple';

print_r($tree);

$arrayiter = new RecursiveArrayIterator($tree);
$iteriter = new RecursiveIteratorIterator($arrayiter);

foreach ($iteriter as $key => $value) {
  $d = $iteriter->getDepth();
  echo "depth=$d k=$key v=$value\n";
}
?>
karp@karp:~/tmp/php/1$ php recursiveiteratoriterator-getdepth.php 
Array
(
    [1] => Array
        (
            [2] => Array
                (
                    [3] => lemon
                )

            [4] => melon
        )

    [2] => Array
        (
            [3] => orange
            [5] => grape
        )

    [3] => pineapple
)
depth=2 k=3 v=lemon
depth=1 k=4 v=melon
depth=1 k=3 v=orange
depth=1 k=5 v=grape
depth=0 k=3 v=pineapple
karp@karp:~/tmp/php/1$ hhvm recursiveiteratoriterator-getdepth.php 
Array
(
    [1] => Array
        (
            [2] => Array
                (
                    [3] => lemon
                )

            [4] => melon
        )

    [2] => Array
        (
            [3] => orange
            [5] => grape
        )

    [3] => pineapple
)
HipHop Fatal error: Undefined class: RecursiveArrayIterator in /home/karp/tmp/php/1/recursiveiteratoriterator-getdepth.php on line 11
@snope
Copy link

snope commented Jun 26, 2013

I am having the same issue with Propel 1.6.8:

HipHop Fatal error: Class undefined: RecursiveArrayIterator in /lib/vendor/propel/propel1/runtime/lib/config/PropelConfiguration.php on line 180

on:

HipHop VM v2.1.0-dev (rel)
Compiler: heads/master-0-g2811e9da940bb040bd82b2c7d91ff27830e1af32
Repo schema: 2b27275abf1ac815b674d97fa45aed9aac8a6290

@scannell
Copy link
Contributor

HHVM hasn't implemented this class yet. We're slowly working through a backlog of compatibility issues. If you want to submit a pull request with an implementation of it, please feel free!

@snope
Copy link

snope commented Jun 26, 2013

Thanks for clarifying! Unfortunately my coding skills aren't that good to be really helpful.

@ghost ghost assigned ptarjan Jul 22, 2013
@scannell
Copy link
Contributor

This blocks Symphony as well so we should be fixing this soon.

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

No branches or pull requests

4 participants