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/get.phpt
Ilija Tovilo 5b8a5320df Tweak get/set-only hook error messages
Fixes GH-19845
Closes GH-19916
2025-09-23 23:51:24 +02:00

25 lines
324 B
PHP

--TEST--
Basic get only property hook
--FILE--
<?php
class Test {
public $prop {
get { return 42; }
}
}
$test = new Test;
var_dump($test->prop);
try {
$test->prop = 0;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
int(42)
Cannot write to get-only virtual property Test::$prop