UPDATED

Type Declarations in PHP 7 | return

Type declarations simply means specifying which type of variable is being set instead of allowing PHP to set this automatically


0 contributions

208 Views 2
 
 Tags    #tech(13)  

Return type declarations

Array

function getTotal(float $a, float $b) : array {
    return [];
}

boolean

function getTotal(float $a, float $b) : bool {
    return 1 == 1;
}

Integer

function sum(int $a, int $b) : int {
    return $a + $b;
}


Please login before Adding Contribution

LOGIN

 


Input Item is required

{{value.error}} Invalid Url Found


{{value.title|truncate:'50':'...'}}

{{value.description|truncate:'70':'...'}}

Source:{{value.url|truncate:'50':'...'}}
{{value.error}} {{value.serror}} Input Item is Required





Source:{{value.cite}}





{{value.error}} Input Item is Required



Instagram Logo
{{value.error}} Input Item is Required



{{value.error}} {{value.serror}} Input Item is Required





{{value.snippet.title}}
{{value.snippet.description|truncate:'20':'...'}} {{value.snippet.channelTitle}}
Views {{value.statistics.viewCount|number}}


Preview will appear here..
No Gifs Found