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

31 lines
456 B
PHP

--TEST--
Accessing property from hook does not call magic method
--FILE--
<?php
class Test {
public $prop {
get => $this->prop;
set => $value;
}
public function __get($name) {
echo __METHOD__, "\n";
return 42;
}
public function __set($name, $value) {
echo __METHOD__, "\n";
}
}
$test = new Test;
var_dump($test->prop);
$test->prop = 42;
var_dump($test->prop);
?>
--EXPECT--
NULL
int(42)