php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #43237 request for adding error when deserialising undefined
Submitted: 2007-11-10 21:11 UTC Modified: 2007-11-11 15:06 UTC
From: nelson dot cabral at gmail dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.5 OS: mac
Private report: No CVE-ID: None
 [2007-11-10 21:11 UTC] nelson dot cabral at gmail dot com
Description:
------------
Hi,

I lost four hours debbuging a stupid-useless bug. I created an object Adress and then wanted to give it to another php page via header().
That's what I did : 

## file A.php ##
include (Adress.php); // contains Adress object definition
$temp = new Address();
$_SESSION["temp"] = serialize($temp);
header(Location: B.php);

## file B.php ##
$temp = unserialize($_SESSION[$temp]);
echo $temp->street; // echo nothing because file B doesn't include Address.php

Two way of finding my error a lot faster : 
- the system could have crashed when I deserialized the object because it didn'n new the object type
- the system could have crashed when I tried to use the object attribute for the same reason

Please make a decent programming language out of php, save the world.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-11 15:06 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

THis actually does give a warning if you\'re smart enough to use E_ALL.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 09:01:29 2024 UTC