summaryrefslogtreecommitdiff
path: root/ext/date/tests/bug62500.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/tests/bug62500.phpt')
-rw-r--r--ext/date/tests/bug62500.phpt28
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/date/tests/bug62500.phpt b/ext/date/tests/bug62500.phpt
new file mode 100644
index 0000000000..6952332014
--- /dev/null
+++ b/ext/date/tests/bug62500.phpt
@@ -0,0 +1,28 @@
+--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)"