File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
Zend /
tests /
closure_026.phpt
Revision
1.1.1.2 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue May 29 12:34:36 2012 UTC (12 years, 9 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
HEAD
php 5.4.3+patches
--TEST--
Closure 026: Assigning a closure object to an array in $this
--FILE--
<?php
class foo {
public function __construct() {
$a =& $this;
$a->a[] = function() {
return 1;
};
var_dump($this);
var_dump($this->a[0]());
}
}
$x = new foo;
print "--------------\n";
foreach ($x as $b => $c) {
var_dump($b, $c);
var_dump($c[0]());
}
?>
--EXPECTF--
object(foo)#%d (1) {
["a"]=>
array(1) {
[0]=>
object(Closure)#%d (1) {
["this"]=>
*RECURSION*
}
}
}
int(1)
--------------
string(1) "a"
array(1) {
[0]=>
object(Closure)#%d (1) {
["this"]=>
object(foo)#%d (1) {
["a"]=>
*RECURSION*
}
}
}
int(1)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>