Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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;
}
 
PREVIOUS NEXT
Tagged: #Required #parameter #optional #parameter #Internal #Server #php
ADD COMMENT
Topic
Name
1+9 =