Как сравнить два вызываемых типа, чтобы проверить, равны ли они?
function addCallable(callable $cb)
{
if(/*already exists*/)
throw new Exception("Callable was already added to the collection");
else
$this->collection[] = $cb;
}
function removeCallable(callable $cb)
{
$key = array_search(/* ??? */);
unset($this->collection[$key]);
}
$this->addCallable(array('MyClass', 'myCallbackMethod'));
try{ $this->addCallable('MyClass::myCallbackMethod'); }catch(Exception $e){}
$this->removeCallable('MyClass::myCallbackMethod');
Подробнее здесь: https://stackoverflow.com/questions/240 ... able-types
Как сравнить вызываемые типы PHP? ⇐ Php
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение