php-src/Zend/tests/clone_004.phpt
2018-10-14 12:07:20 -03:00

22 lines
322 B
PHP

--TEST--
Testing usage of object as array on clone statement
--FILE--
<?php
class foo {
public function __get($a) {
return new $this;
}
}
$c = new foo;
$a = clone $c->b[1];
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot use object of type foo as array in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d