From 43707811b1fc99d343186490b934a3053909f57f Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 8 Feb 2019 11:23:38 +0100 Subject: [PATCH] Add a typed property test --- tests/typed_prop.phpt | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/typed_prop.phpt diff --git a/tests/typed_prop.phpt b/tests/typed_prop.phpt new file mode 100644 index 00000000..80f0d3c0 --- /dev/null +++ b/tests/typed_prop.phpt @@ -0,0 +1,35 @@ +--TEST-- +Success parameters should respect property types +--SKIPIF-- +=') or die('skip Requires PHP >= 7.4'); +?> +--INI-- +apc.enabled=1 +apc.enable_cli=1 +--FILE-- +bool); +var_dump($test->bool); +try { + apcu_fetch('foo', $test->array); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} +var_dump($test->array); + +?> +--EXPECT-- +bool(true) +Cannot assign bool to reference held by property Test::$array of type array +array(0) { +}