mirror of
https://github.com/php/php-src.git
synced 2024-12-25 01:40:50 +08:00
eb0ba9068d
- New tests
38 lines
401 B
PHP
38 lines
401 B
PHP
--TEST--
|
|
Trying to write on method return
|
|
--FILE--
|
|
<?php
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
class foo {
|
|
public $x = array();
|
|
|
|
public function b() {
|
|
return $this->x;
|
|
}
|
|
|
|
public function c() {
|
|
return $x;
|
|
}
|
|
|
|
static public function d() {
|
|
|
|
}
|
|
}
|
|
|
|
$foo = new foo;
|
|
|
|
$foo->b()[0] = 1;
|
|
|
|
$foo->c()[100] = 2;
|
|
|
|
foo::d()[] = 3;
|
|
|
|
print "ok\n";
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Notice: Undefined variable: x in %s on line %d
|
|
ok
|