- Create foo function that returns array with multiple values - Implement array destructuring assignment in main function - Add php_uname call to demonstrate system information output - Show usage of spread operator for variable assignmentpull/20/head
parent
8be62dafb3
commit
fa7e2cf7c1
1 changed files with 15 additions and 0 deletions
@ -0,0 +1,15 @@ |
||||
<?php |
||||
function foo(): array { |
||||
$a = 1; |
||||
$b = 2; |
||||
$c = 3; |
||||
return [$a, $b, $c]; |
||||
} |
||||
|
||||
function main() |
||||
{ |
||||
var_dump(php_uname()); |
||||
[$a, $b, $c] = foo(); |
||||
var_dump($a, $b, $c); |
||||
} |
||||
|
||||
Loading…
Reference in new issue