ID: 49516
Updated by: [email protected]
Reported By: oorza2k5 at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
Operating System: irrelevant
PHP Version: 5.3.0
New Comment:
Closures are special. And since they're so special, they throw
exceptions. Not a bug.
Previous Comments:
------------------------------------------------------------------------
[2009-09-10 06:15:08] oorza2k5 at gmail dot com
Description:
------------
As far as I'm aware, exceptions are not supposed to be thrown by
default, but rather errors are supposed to be raised.
Serializing a closure throws an exception, when it should be raising an
E_ERROR instead.
Reproduce code:
---------------
<?php
$foo = function() { };
serialize($foo);
Expected result:
----------------
E_ERROR is raised and the script dies.
Actual result:
--------------
An exception is thrown.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49516&edit=1