diff options
-rw-r--r-- | Zend/tests/recv_init_ref_type.phpt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Zend/tests/recv_init_ref_type.phpt b/Zend/tests/recv_init_ref_type.phpt new file mode 100644 index 0000000000..29b96d379f --- /dev/null +++ b/Zend/tests/recv_init_ref_type.phpt @@ -0,0 +1,18 @@ +--TEST-- +Check by-ref RECV_INIT with single type +--FILE-- +<?php + +function test(array &$foo = []) { +} + +try { + $bar = 42; + test($bar); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECTF-- +test(): Argument #1 ($foo) must be of type array, int given, called in %s on line %d |