note 126181 added to migration80.deprecated
| From: | dominique.vienne.ik.me via php-notes | Date: | Mon, 21 Jun 2021 13:23:10 +0000 |
| Subject: | note 126181 added to migration80.deprecated | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216533@lists.php.net to get a copy of this message | ||
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! ;)
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 62.167.91.75)
----
Manual Page -- https://php.net/manual/en/migration80.deprecated.php
Edit -- https://main.php.net/note/edit/126181
Del: integrated -- https://main.php.net/note/delete/126181/integrated
Del: useless -- https://main.php.net/note/delete/126181/useless
Del: bad code -- https://main.php.net/note/delete/126181/bad+code
Del: spam -- https://main.php.net/note/delete/126181/spam
Del: non-english -- https://main.php.net/note/delete/126181/non-english
Del: in docs -- https://main.php.net/note/delete/126181/in+docs
Del: other reasons-- https://main.php.net/note/delete/126181
Reject -- https://main.php.net/note/reject/126181
Search -- https://main.php.net/manage/user-notes.php