Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,13 @@
<?php
function printAll() {
foreach (func_get_args() as $x) // first way
echo "$x\n";
$numargs = func_num_args(); // second way
for ($i = 0; $i < $numargs; $i++)
echo func_get_arg($i), "\n";
}
printAll(4, 3, 5, 6, 4, 3);
printAll(4, 3, 5);
printAll("Rosetta", "Code", "Is", "Awesome!");
?>

View file

@ -0,0 +1,4 @@
<?php
$args = array("Rosetta", "Code", "Is", "Awesome!");
call_user_func_array('printAll', $args);
?>

View 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!");
?>

View file

@ -0,0 +1,4 @@
<?php
$args = ["Rosetta", "Code", "Is", "Awesome!"];
printAll(...$args);
?>