Re: ze2 segfault #2
| From: | Sterling Hughes | Date: | Fri, 21 Mar 2003 21:58:24 +0000 |
| Subject: | Re: ze2 segfault #2 | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-95208@lists.php.net to get a copy of this message | ||
Nevermind, I found the bug, and I have a fix that I'm testing right now.
-Sterling
On Fri, 2003-03-21 at 16:53, Sterling Hughes wrote:
> When running the following example through pres2 (apache 1.3.27), I get
> a segfault.. Sample pres2 file.
>
> <slide>
> <title>Interfaces Suck</title>
> <blurb>They really do</blurb>
> <example filename="interface2.php" result="1" />
> </slide>
>
> interface2.php::
>
> <?php
> interface ISerializable {
> function sleep();
> function wakeup();
> };
>
> class Person implements ISerializable {
> public $name;
>
> function sleep() {
> file_set_contents("serialized",
> serialize($this->name)
> );
> }
>
> function wakeup() {
> $this->name = unserialize(
> file_get_contents("serialized")
> );
> }
> }
>
> $p = new Person;
> if ($p instanceof ISerializable) {
> $p->wakeup();
> }
> echo "Previous Spy: {$p->name}\n";
> $superspies = array('James Bond',
> 'Sterling Hughes',
> 'Austin Powers');
> $p->name = $superspies[array_rand($superspies)];
> echo "New Spy: {$p->name}\n";
>
> if ($p instanceof ISerializable) {
> $p->sleep();
> }
> ?>
>
> --
> "Nothing is particularly hard if you divide it into small jobs."
> - Henry Ford
--
"Programming today is a race between software engineers stirring to
build bigger and better idiot-proof programs, and the universe trying
to produce bigger and better idiots. So far, the universe is winning."
- Unknown