hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

ArrayObject not creating multi-dimension arrays

Open franz-deleon opened this issue 12 years ago • 1 comments

I have this code:

<?php
class FStack extends ArrayObject {}

$stack = new FStack;
$stack['foo']['bar'] = "hello";

var_dump($stack);

In php it should return:

object(FStack)#1 (1) {
  ["storage":"ArrayObject":private]=>
  array(1) {
    ["bat"]=>
    array(1) {
      ["foo"]=>
      string(5) "hello"
    }
  }
}

but in hhvm it returns (PROBLEM):

object(FStack)#1351 (0) { }

Although a one dimensional array returns my expected result so this works:

<?php
class FStack extends ArrayObject {}

$stack = new FStack;
$stack['foo'] = "hello";

var_dump($stack);

returns in hhvm:

object(FStack)#1352 (1) { ["foo"]=> string(5) "hello" }

in php:

object(FStack)[1]
  public 'foo' => string 'hello' (length=5)

heres my hhvm version:

$ hhvm --version
HipHop VM 2.4.1 (rel)
Compiler: tags/2.4.1-0-g072ec429a4c42b481aabaa8bca0210b288a8d55e
Repo schema: c406b364610281efade7dc69dd427f7d8e4c4550

franz-deleon avatar Feb 26 '14 21:02 franz-deleon

ahh sorry i didnt realize this is related to #1907

franz-deleon avatar Feb 26 '14 22:02 franz-deleon