Skip to content

Commit f0117e4

Browse files
authored
Merge pull request #62 from reactphp/no7-libevent
Discourage libevent on PHP 7
2 parents ed4b051 + f1c4746 commit f0117e4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Factory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ class Factory
77
public static function create()
88
{
99
// @codeCoverageIgnoreStart
10-
if (function_exists('event_base_new')) {
11-
return new LibEventLoop();
12-
} elseif (class_exists('libev\EventLoop', false)) {
10+
if (class_exists('libev\EventLoop', false)) {
1311
return new LibEvLoop;
1412
} elseif (class_exists('EventBase', false)) {
1513
return new ExtEventLoop;
14+
} elseif (function_exists('event_base_new') && PHP_VERSION_ID < 70000) {
15+
// only use ext-libevent on PHP < 7 for now
16+
return new LibEventLoop();
1617
}
1718

1819
return new StreamSelectLoop();

0 commit comments

Comments
 (0)