mirror of
https://github.com/php/php-src.git
synced 2024-12-12 03:15:29 +08:00
3b08f53c97
As an exception, we allow "Type $foo = null" to occur before a required parameter, because this pattern was used as a replacement for nullable types in PHP versions older than 7.1. Closes GH-5067.
15 lines
459 B
PHP
15 lines
459 B
PHP
--TEST--
|
|
Required parameter after optional is deprecated
|
|
--FILE--
|
|
<?php
|
|
|
|
function test($testA = null, $testB = null, $testC) {}
|
|
function test2(Type $test2A = null, $test2B = null, $test2C) {}
|
|
function test3(Type $test3A = null, Type2 $test3B = null, $test3C) {}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Deprecated: Required parameter $testC follows optional parameter $testA in %s on line %d
|
|
|
|
Deprecated: Required parameter $test2C follows optional parameter $test2B in %s on line %d
|