2
Bug #36214 (__get method works properly only when conditional operator is used)
4
<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?>
8
public $stack = array();
10
public function __set($name,$var) {
11
$this->stack[$name] = $var;return;
14
public function &__get($name) {
15
return $this->stack[$name];
20
$ctx->comment_preview = array();
21
$ctx->comment_preview[0] = 1;
22
$ctx->comment_preview[1] = 2;
23
var_dump($ctx->comment_preview);
25
$comment_preview = array();
26
$comment_preview[0] = 1;
27
$comment_preview[1] = 2;
28
$ctx->comment_preview = $comment_preview;
29
var_dump($ctx->comment_preview);
31
$ctx->comment_preview = new ArrayObject();
32
$ctx->comment_preview[0] = 1;
33
$ctx->comment_preview[1] = 2;
34
var_dump($ctx->comment_preview);
49
object(ArrayObject)#2 (2) {