The following GET handler works fine on PHP 7, but on PHP 8 produces a fatal Error:
/**
* @uri /path/to/resource/{whatever}
*/
class MyResource extends Resource {
public function get($whatever) {
/* body */
}
}
The Error is raised on the line in Resource.php trying to invoke the get function:
$response = Response::create(call_user_func_array(array($this, $methodName), $this->params));
The error looks like:
Fatal error: Uncaught Error: Named parameter $model overwrites previous argument in /home/me/project/lib/tonic/src/Tonic/Resource.php on line 153
Error: Named parameter $model overwrites previous argument in /home/me/project/lib/tonic/src/Tonic/Resource.php on line 153
Call Stack: 0.0003 385808
1. {main}() /home/me/project/restTonic.php:0 0.1378 2369704
2. Tonic\Resource->exec() /home/me/project/restTonic.php:19 0.1380 2370944
3. call_user_func_array:{/home/me/project/lib/tonic/src/Tonic/Resource.php:153}
This looks like normal PHP 8 behaviour. Would tonic need a rewrite to support PHP 8 or is there some simpler workaround we can employ? (or move to a completely different library)
The following GET handler works fine on PHP 7, but on PHP 8 produces a fatal Error:
The Error is raised on the line in Resource.php trying to invoke the
getfunction:The error looks like:
This looks like normal PHP 8 behaviour. Would
tonicneed a rewrite to support PHP 8 or is there some simpler workaround we can employ? (or move to a completely different library)