Download src/php/php-src/Zend/tests/asymmetric_visibility/reference_2.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 516 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/asymmetric_visibility/reference_2.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/asymmetric_visibility/reference_2.phpt
-
curl -L -o reference_2.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/asymmetric_visibility/reference_2.phpt
516 Bytes
| --TEST-- | |
| Asymmetric visibility reference in forbidden scope | |
| --FILE-- | |
| class C { | |
| public private(set) int $prop = 1; | |
| } | |
| function test($c) { | |
| $prop = &$c->prop; | |
| $prop = 42; | |
| } | |
| try { | |
| test(new C()); | |
| } catch (Error $e) { | |
| echo $e->getMessage(), "\n"; | |
| } | |
| try { | |
| test(new C()); | |
| } catch (Error $e) { | |
| echo $e->getMessage(), "\n"; | |
| } | |
| --EXPECT-- | |
| Cannot indirectly modify private(set) property C::$prop from global scope | |
| Cannot indirectly modify private(set) property C::$prop from global scope | |