eval.in

Paste #16806

PHP — PHP 5.4.6, pasted 1 year ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

error_reporting(-1);

class Foo
{
    private $foo = 'foo';
}

class Bar extends Foo
{
    private $bar = 'bar';


    public function __sleep()
    {
        return array(
            chr(0) . 'Foo' . chr(0) . 'foo', 
            'bar'
        );
    }

}

echo serialize(new Bar);

Program Output

O:3:"Bar":2:{s:8:"Foofoo";s:3:"foo";s:8:"Barbar";s:3:"bar";}

OK (0.008 sec real, 0.008 sec wall, 13 MB, 42 syscalls)

Fork