bug62500.phpt 599 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Bug #62500 (Segfault in DateInterval class when extended)
  3. --INI--
  4. date.timezone=GMT
  5. --FILE--
  6. <?php
  7. class Crasher extends DateInterval {
  8. public $foo;
  9. public function __construct($time_spec) {
  10. var_dump($this->foo);
  11. $this->foo = 3;
  12. var_dump($this->foo);
  13. var_dump($this->{2});
  14. parent::__construct($time_spec);
  15. }
  16. }
  17. try {
  18. $c = new Crasher('blah');
  19. } catch (Exception $e) {
  20. var_dump($e->getMessage());
  21. }
  22. ?>
  23. --EXPECTF--
  24. NULL
  25. int(3)
  26. Warning: Undefined property: Crasher::$2 in %s on line %d
  27. NULL
  28. string(28) "Unknown or bad format (blah)"