]> granicus.if.org Git - php/commitdiff
Add test case for previous commit
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 24 Jun 2020 08:51:51 +0000 (10:51 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 24 Jun 2020 08:51:51 +0000 (10:51 +0200)
Forgot to "git add".

Zend/tests/recv_init_ref_type.phpt [new file with mode: 0644]

diff --git a/Zend/tests/recv_init_ref_type.phpt b/Zend/tests/recv_init_ref_type.phpt
new file mode 100644 (file)
index 0000000..29b96d3
--- /dev/null
@@ -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