With PHP 5.6, we can use the ... (T_ELLIPSIS) operator
<?php
class Test {
public function __construct($a, $b) {
echo $a . ' ' . $b;
}
}
$args = array(12, 34);
new Test(... $args); // Displays "12 34"
?>
With PHP 5.6, we can use the ... (T_ELLIPSIS) operator
<?php
class Test {
public function __construct($a, $b) {
echo $a . ' ' . $b;
}
}
$args = array(12, 34);
new Test(... $args); // Displays "12 34"
?>