Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000572 [Quercus] minor always 12-26-05 12:18 12-27-05 16:01
Reporter creich View Status @0@  
Assigned To creich
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0000572: serialize / unserialize
Description not working properly for arrays and objects. (IE: php/1225.qa)

Need to add a test for objects.
Additional Information
Attached Files

- Relationships

- Notes
(0000579)
creich
12-26-05 13:35
edited on: 12-26-05 13:37

The following example is taken from http://us2.php.net/manual/en/language.oop.serialization.php [^]


<?php
// classa.inc:
 
  class A {
     var $one = 1;
  
     function show_one() {
         echo $this->one;
     }
  }
 
// page1.php:

  include("classa.inc");
 
  $a = new A;
  $s = serialize($a);
  // store $s somewhere where page2.php can find it.
  $fp = fopen("store", "w");
  fwrite($fp, $s);
  fclose($fp);

// page2.php:
 
  // this is needed for the unserialize to work properly.
  include("classa.inc");

  $s = implode("", @file("store"));
  $a = unserialize($s);

  // now use the function show_one() of the $a object.
  $a->show_one();
?>

Should echo "1", instead var_dump($a) returns NULL, so show_one() returns "Undefined method".


NB: Remember to check __sleep() and __wakeup()

 
(0000586)
ferg
12-27-05 16:01

php/1218, php/1228
 

- Issue History
Date Modified Username Field Change
12-26-05 12:18 creich New Issue
12-26-05 12:18 creich Status new => assigned
12-26-05 12:18 creich Assigned To  => creich
12-26-05 13:35 creich Note Added: 0000579
12-26-05 13:37 creich Note Edited: 0000579
12-27-05 16:01 ferg Status assigned => closed
12-27-05 16:01 ferg Note Added: 0000586
12-27-05 16:01 ferg Resolution open => fixed
12-27-05 16:01 ferg Fixed in Version  => 3.0.18


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
32 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker