PHP 8.5.0 Beta 1 available for testing

Voting

: min(seven, two)?
(Example: nine)

The Note You're Voting On

dominique dot vienne at ik dot me
4 years ago
If you try to get all methods / functions assigning an optional argument before a mandatory one, try this regex (single line)

<?php
function\s
+[a-z][a-zA-Z0-9_]*\((?:\$[a-z][a-zA-Z0-9]*\s*,\s*)*
(?:\$[
a-z][A-Za-z0-9_]*\s*=[^\$\)]+)+\$[a-z][a-zA-Z0-9_]*\)
?>

for
<?php
public function test($a, $b) {
$a = [];
$b = [$abc => $ss[],
];
}

private function
too($c, $a = true, $b) {
}

protected function
bar($a = []) {
}

public function
foo($a, $b = true) {
}

public function
fooBar32($a=true, $b = [], $c) {
}

private function
oo_bAr($a = []) {
}
?>
it will match too() and fooBar32()

Have a nice migration! ;)

<< Back to user notes page

To Top