File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / date / tests / bug62500.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:31:39 2013 UTC (11 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

--TEST--
Bug #62500 (Segfault in DateInterval class when extended)
--INI--
date.timezone=GMT
--FILE--
<?php
class Crasher extends DateInterval {
    public $foo;
    public function __construct($time_spec) {
        var_dump($this->foo);
        $this->foo = 3;
        var_dump($this->foo);
        var_dump($this->{2});
        parent::__construct($time_spec);
    }
}
try {
    $c = new Crasher('blah');
} catch (Exception $e) {
    var_dump($e->getMessage());
}
--EXPECTF--
NULL
int(3)

Notice: Undefined property: Crasher::$2 in %sbug62500.php on line %d
NULL
string(%s) "DateInterval::__construct(): Unknown or bad format (blah)"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>