xref: /php-src/Zend/tests/gh11488.phpt (revision 2079da01)
1--TEST--
2GH-11488: "Optional parameter before required" warning for union nullable type
3--FILE--
4<?php
5function a(
6    string|null $a = null,
7    $b,
8) {}
9function b(
10    Foo&Bar $c = null,
11    $d,
12) {}
13function c(
14    (Foo&Bar)|null $e = null,
15    $f,
16) {}
17?>
18--EXPECTF--
19Deprecated: a(): Optional parameter $a declared before required parameter $b is implicitly treated as a required parameter in %s on line %d
20
21Deprecated: b(): Implicitly marking parameter $c as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d
22
23Deprecated: c(): Optional parameter $e declared before required parameter $f is implicitly treated as a required parameter in %s on line %d
24