Strict Standards: Declaration of action_plugin_importoldindex::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/html/lib/plugins/importoldindex/action.php on line 8

Strict Standards: Declaration of action_plugin_popularity::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/html/lib/plugins/popularity/action.php on line 57

Strict Standards: Declaration of action_plugin_safefnrecode::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/html/lib/plugins/safefnrecode/action.php on line 66

Strict Standards: Declaration of action_plugin_importoldchangelog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/html/lib/plugins/importoldchangelog/action.php on line 182

Strict Standards: Declaration of Doku_Renderer_metadata::table_open() should be compatible with Doku_Renderer::table_open($maxcols = NULL, $numrows = NULL, $pos = NULL) in /var/www/html/inc/parser/metadata.php on line 24

Strict Standards: Declaration of Doku_Renderer_metadata::table_close() should be compatible with Doku_Renderer::table_close($pos = NULL) in /var/www/html/inc/parser/metadata.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/lib/plugins/importoldindex/action.php:8) in /var/www/html/inc/actions.php on line 180
 cor4:app:trycatch [Cor4 WIki]

Try - Catch block

Jelenleg a következőképpen van támogatva a try...catch PHP szerkezet:

try {
  throw $a;
}
catch ($r) {
  var_dump($r);
}

Az eltérés a PHP-tól a következőkben nyilvánul meg:

  1. a catch ágban nem adható meg típus
  2. az előzőből következik, hogy csak egy catch ág lehet
  3. viszont tetszőleges változó dobható (tehát a példában a $a lehet akár tömb is)
  4. az Exception osztály létezik, de a nyelvben nincs lehetőség származtatásra, ezért használata nehézkes

cor4/app/trycatch.txt · Last modified: 2021/01/05 11:39 (external edit)