Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 7c18367

Browse files
committed
Fixes zendframework#345 - CallbackHandler throws warning if WeakRef-extension not installed
1 parent a22b33d commit 7c18367

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

library/Zend/Stdlib/CallbackHandler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ protected function registerCallback($callback)
101101
}
102102

103103
// If pecl/weakref is not installed, simply store the callback and return
104-
if (!class_exists('WeakRef')) {
104+
set_error_handler(array($this, 'errorHandler'), E_WARNING);
105+
$callable = class_exists('WeakRef');
106+
restore_error_handler();
107+
if (!$callable || $this->error) {
105108
$this->callback = $callback;
106109
return;
107110
}

0 commit comments

Comments
 (0)