2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,3 +1,4 @@
|
|||
<?php
|
||||
function printAll() {
|
||||
foreach (func_get_args() as $x) // first way
|
||||
echo "$x\n";
|
||||
|
|
@ -9,3 +10,4 @@ function printAll() {
|
|||
printAll(4, 3, 5, 6, 4, 3);
|
||||
printAll(4, 3, 5);
|
||||
printAll("Rosetta", "Code", "Is", "Awesome!");
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,4 @@
|
|||
<?php
|
||||
$args = array("Rosetta", "Code", "Is", "Awesome!");
|
||||
call_user_func_array('printAll', $args);
|
||||
?>
|
||||
|
|
|
|||
9
Task/Variadic-function/PHP/variadic-function-3.php
Normal file
9
Task/Variadic-function/PHP/variadic-function-3.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
function printAll(...$things) {
|
||||
foreach ($things as $x)
|
||||
echo "$x\n";
|
||||
}
|
||||
printAll(4, 3, 5, 6, 4, 3);
|
||||
printAll(4, 3, 5);
|
||||
printAll("Rosetta", "Code", "Is", "Awesome!");
|
||||
?>
|
||||
4
Task/Variadic-function/PHP/variadic-function-4.php
Normal file
4
Task/Variadic-function/PHP/variadic-function-4.php
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
$args = ["Rosetta", "Code", "Is", "Awesome!"];
|
||||
printAll(...$args);
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue