Skip to content

Commit

Permalink
Fixes zendframework#345 - CallbackHandler throws warning if WeakRef-e…
Browse files Browse the repository at this point in the history
…xtension not installed
  • Loading branch information
froschdesign committed Dec 3, 2014
1 parent a22b33d commit 7c18367
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/Zend/Stdlib/CallbackHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ protected function registerCallback($callback)
}

// If pecl/weakref is not installed, simply store the callback and return
if (!class_exists('WeakRef')) {
set_error_handler(array($this, 'errorHandler'), E_WARNING);
$callable = class_exists('WeakRef');
restore_error_handler();
if (!$callable || $this->error) {
$this->callback = $callback;
return;
}
Expand Down

0 comments on commit 7c18367

Please sign in to comment.