#49516 [NEW]: Serializing a closure throws an exception

From: Date: Thu, 10 Sep 2009 06:15:09 +0000
Subject: #49516 [NEW]: Serializing a closure throws an exception
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-142197@lists.php.net to get a copy of this message
From:             oorza2k5 at gmail dot com
Operating system: irrelevant
PHP version:      5.3.0
PHP Bug Type:     Class/Object related
Bug description:  Serializing a closure throws an exception

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 bug report at http://bugs.php.net/?id=49516&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=49516&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=49516&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=49516&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=49516&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49516&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=49516&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=49516&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=49516&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=49516&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=49516&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=49516&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=49516&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=49516&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=49516&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=49516&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=49516&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=49516&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=49516&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=49516&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=49516&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=49516&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#142197) next »