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