xref: /PHP-7.1/Zend/tests/clone_004.phpt (revision 7af945e2)
1--TEST--
2Testing usage of object as array on clone statement
3--FILE--
4<?php
5
6error_reporting(E_ALL|E_STRICT);
7
8class foo {
9	public function __get($a) {
10		return new $this;
11	}
12}
13
14$c = new foo;
15
16$a = clone $c->b[1];
17
18?>
19--EXPECTF--
20Fatal error: Uncaught Error: Cannot use object of type foo as array in %s:%d
21Stack trace:
22#0 {main}
23  thrown in %s on line %d
24