Arquivos
hhvm/hphp/test/vm/collection-initializer.php.exp
T
andrewparoski b9e14c448c Support collection literals in initializers
This diff updates the parser and runtime to support using collection
literals in initializer expressions for instance properties, static
properties, parameters, and static locals.

The runtime as-is was able to correctly handle collection literals in
initializers for static properties, parameters, and static locals. However,
for instance properties I needed to way to make it so that each instance
got a fresh copy of the collection literal.

To achieve this, I added an attribute to indicate that a property requires
'deep' intiialization. When this attribute is set, the Class machinery
will not call setEvalScalar() on the initial value (the value produced by
86pinit), and it will make a deep copy of the initial value when a new
instance of the Class is allocated.
2013-03-08 17:52:31 -08:00

34 linhas
330 B
Plaintext

int(1)
int(2)
bool(false)
=========
int(3)
int(3)
bool(true)
=========
int(1)
int(2)
bool(false)
string(6) "Vector"
=========
bool(false)
int(2)
int(3)
bool(false)
=========
bool(true)
int(2)
int(3)
bool(false)
=========
int(2)
int(1)
int(2)
int(1)
=========
string(4) "blah"
string(2) "yo"
int(2)
string(4) "blah"
string(2) "yo"