php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54641 splfileinfo aborts connection when added to session
Submitted: 2011-04-30 23:20 UTC Modified: 2011-05-01 12:59 UTC
From: alex at phpguide dot co dot il Assigned:
Status: Not a bug Package: SPL related
PHP Version: 5.3.6 OS: windows 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alex at phpguide dot co dot il
New email:
PHP Version: OS:

 

 [2011-04-30 23:20 UTC] alex at phpguide dot co dot il
Description:
------------
Attempting to put SplFileInfo into session
results in Connection Was Reset

Test script:
---------------
<?php
session_start();
$_SESSION['dying connection'] = new SplFileInfo(__FILE__);

Actual result:
--------------
Connection was reset

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-30 23:24 UTC] alex at phpguide dot co dot il
seems like
Uncaught exception 'Exception' with message 'Serialization of 'SplFileInfo' is not allowed'
has to be related.

Should be documented somewhere somehow :/

Yet as another bug: unserializable objects lead to unexpected results when put in session instead of producing any warning or exception.
 [2011-04-30 23:34 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2011-04-30 23:34 UTC] pajoye@php.net
No bug here, it is not allowed nor supported to serialize SplFileInfo instances.
 [2011-05-01 12:51 UTC] alex at phpguide dot co dot il
Would be lovely to have any warning saying that
when the system attempts to perform serialization for objects not supporting that
 [2011-05-01 12:59 UTC] pajoye@php.net
SPL raises exception, catching them sounds like a good plan.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon Feb 02 07:00:01 2026 UTC