Answers for "Required parameter follows optional parameter (500 Internal Server Error) php"

PHP
0

Required parameter follows optional parameter (500 Internal Server Error) php

The required parameter without a default value should come first (according to php 8.0)

Wrong Way:
function test_function(int $yyy = 2, int $xxx)
{
    return $xxx * $yyy;
}  

Right Way:
function test_function(int $xxx, int $yyy = 2)
{
    return $xxx * $yyy;
}
Posted by: Guest on February-14-2022

Code answers related to "Required parameter follows optional parameter (500 Internal Server Error) php"

Browse Popular Code Answers by Language