{"action":"closed","issue":{"number":100,"created_at":"2011-10-17T15:53:54Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Scope of Change\n====\nMethods declared with type hints will throw an IllegalArgumentException when \ntype mismatches occur.\n\n\nRationale\n====\nFatal error prevention.\n\n\nFunctionality\n====\n\nWhat happens currently\n----\n\n```\n$ php5 -r 'class Test { static function x(Object $o) { }} Test::x();'\n\nFatal error: Argument 1 passed to Test::x() must be an object of class \nObject, called in Command line code on line 1 and defined in Command \nline code on line 1\n\n```\n\nHow to fix it\n----\nPrepending this:\n\n```php\n<?php\n  set_error_handler(\n    create_function('$c, $m', 'throw new Exception($m);'),\n    E_RECOVERABLE_ERROR\n  );\n?>\n```\n... to the above code will yield in an uncaught exception instead of\na fatal error.\n\n\nSecurity considerations\n====\nn/a\n\n\nSpeed impact\n====\nn/a\n\n\nDependencies\n====\n- This RFC will bump the version number to 5.3.0\n\n\nRelated documents\n====\n- http://xp-framework.net/rfc/contrib/rfc0100.diff\n  Patch for lang.base.php\n\n- http://www.derickrethans.nl/erecoverableerror.php\n  E_RECOVERABLE_ERROR announce\n\n","comments":0,"title":"IllegalArgumentException for Type hints","updated_at":"2011-10-17T15:53:54Z","url":"https://api.github.com/repos/xp-framework/rfc/issues/100","id":1930163,"assignee":null,"milestone":null,"closed_at":"2011-10-17T15:53:54Z","user":{"gravatar_id":"26f07e3b262e9a80436f368cb11bd0c2","avatar_url":"https://secure.gravatar.com/avatar/26f07e3b262e9a80436f368cb11bd0c2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/thekid","id":696742,"login":"thekid"},"html_url":"https://github.com/xp-framework/rfc/issues/100","labels":[{"name":"framework","url":"https://api.github.com/repos/xp-framework/rfc/labels/framework","color":"118f5b"},{"name":"implemented","url":"https://api.github.com/repos/xp-framework/rfc/labels/implemented","color":"807370"}],"state":"closed"},"legacy":{"number":100,"action":"closed","issue":1930163}}