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/property_hooks/inheritance.phpt
2024-07-14 11:55:03 +02:00

33 lines
402 B
PHP

--TEST--
Basic property hook inheritance
--FILE--
<?php
class A {
public $prop {
get { return "A"; }
set { echo __METHOD__, "\n"; }
}
}
class B extends A {
public $prop {
get { return "B"; }
}
}
$a = new A;
var_dump($a->prop);
$a->prop = 1;
$b = new B;
var_dump($b->prop);
$b->prop = 1;
?>
--EXPECT--
string(1) "A"
A::$prop::set
string(1) "B"
A::$prop::set