Re: [PHP-DEV] ze2 segfault #2

2003-03-21 Thread Sterling Hughes
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.
> 
> 
> Interfaces Suck
> They really do
> 
> 
> 
> interface2.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


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] ze2 segfault #2

2003-03-21 Thread Sterling Hughes
When running the following example through pres2 (apache 1.3.27), I get
a segfault..  Sample pres2 file.


Interfaces Suck
They really do



interface2.php::

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


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] segfault with ze2/php5-cvs

2003-03-21 Thread Sterling Hughes
On Fri, 2003-03-21 at 15:12, Joey Smith wrote:
> Very nice.
> 
> What about:
> 
>class person {
>   var $name;
>   }
> 
>   $start = new person;
>   $start->name = 'Eve';
>   $new = $start->__clone();
> ?>
> 
> Does it come back with 'Call to a member function on a non-object'?
> 
> 

I get a segfault with that as well, same error. execute_data is
corrupted.

-Sterling

> On Fri, Mar 21, 2003 at 02:47:06PM -0500, Sterling Hughes wrote:
> >  > class sheep {
> > var $name;
> > }
> > 
> > $start = new sheep;
> > $start->name = "Dolly";
> > $new = $start->__clone();
> > $new->name = "Molly";
> > var_dump($start);
> > ?>
> > 
> > BOOM!
> > 
> > -Sterling
> > -- 
> > Good judgement comes from experience, and experience comes from 
> > bad judgement. 
> > - Fred Brooks
> > 
> > 
> > -- 
> > PHP Development Mailing List 
> > To unsubscribe, visit: http://www.php.net/unsub.php
-- 
"The three most dangerous things in the world are a programmer  
 with a soldering iron, a hardware type with a program patch and  
 a user with an idea." 
- Unknown


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] segfault with ze2/php5-cvs

2003-03-21 Thread Joey Smith
Very nice.

What about:

name = 'Eve';
$new = $start->__clone();
?>

Does it come back with 'Call to a member function on a non-object'?


On Fri, Mar 21, 2003 at 02:47:06PM -0500, Sterling Hughes wrote:
>  class sheep {
> var $name;
> }
> 
> $start = new sheep;
> $start->name = "Dolly";
> $new = $start->__clone();
> $new->name = "Molly";
> var_dump($start);
> ?>
> 
> BOOM!
> 
> -Sterling
> -- 
> Good judgement comes from experience, and experience comes from 
> bad judgement. 
> - Fred Brooks
> 
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] segfault with ze2/php5-cvs

2003-03-21 Thread Sterling Hughes
name = "Dolly";
$new = $start->__clone();
$new->name = "Molly";
var_dump($start);
?>

BOOM!

-Sterling
-- 
Good judgement comes from experience, and experience comes from 
bad judgement. 
- Fred Brooks


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php