1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/bug60833.phpt
Nikita Popov 902d64390e Deprecate implicit dynamic properties
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().

RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00

35 lines
538 B
PHP

--TEST--
Bug #60833 (self, parent, static behave inconsistently case-sensitive)
--FILE--
<?php
class A {
static $x = "A";
function testit() {
var_dump(new sELF);
var_dump(new SELF);
}
}
class B extends A {
static $x = "B";
function testit() {
PARENT::testit();
var_dump(new sELF);
var_dump(new PARENT);
var_dump(STATIC::$x);
}
}
$t = new B();
$t->testit();
?>
--EXPECT--
object(A)#2 (0) {
}
object(A)#2 (0) {
}
object(B)#2 (0) {
}
object(A)#2 (0) {
}
string(1) "B"