Skip to content

Commit d0cc6bd

Browse files
committed
Merge pull request #965
2 parents 46e4d87 + 7af4378 commit d0cc6bd

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

src/MongoDB/Exception/Exception.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
#include <php.h>
18+
#include <zend_exceptions.h>
1819

1920
#ifdef HAVE_CONFIG_H
2021
#include "config.h"
@@ -37,6 +38,10 @@ void php_phongo_exception_init_ce(INIT_FUNC_ARGS) /* {{{ */
3738

3839
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "Exception", php_phongo_exception_me);
3940
php_phongo_exception_ce = zend_register_internal_interface(&ce TSRMLS_CC);
41+
42+
#if PHP_VERSION_ID >= 70000
43+
zend_class_implements(php_phongo_exception_ce TSRMLS_CC, 1, zend_ce_throwable);
44+
#endif
4045
} /* }}} */
4146

4247
/*

tests/cursor/cursorinterface-002.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
MongoDB\Driver\CursorInterface is extending Traversable
2+
MongoDB\Driver\CursorInterface extends Traversable
33
--FILE--
44
<?php
55
var_dump(in_array('Traversable', class_implements('MongoDB\Driver\CursorInterface')));

tests/exception/exception-001.phpt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
MongoDB\Driver\Exception\Exception extends Throwable
3+
--SKIPIF--
4+
<?php if (!interface_exists('Throwable')) { die('skip Throwable is not available'); } ?>
5+
--FILE--
6+
<?php
7+
var_dump(in_array('Throwable', class_implements('MongoDB\Driver\Exception\Exception')));
8+
?>
9+
===DONE===
10+
<?php exit(0); ?>
11+
--EXPECT--
12+
bool(true)
13+
===DONE===

0 commit comments

Comments
 (0)