The error

This error which you see means that PHP failed not at interpretation stage, but at execution stage. As you may know, PHP executes in two steps - first, compile the script into opcodes, then execute those opcodes with virtual machine (normally, that would be ZendVM). The reason because of which we can be sure that it's execution stage fail lies in zend_verify_arg_type() , which is part of execution implementation:

static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg, ulong fetch_type TSRMLS_DC) { //I stripped some lines here (insignificant) if (cur_arg_info->class_name) { /* do the things, when typehinted is class name */ } else if (cur_arg_info->type_hint) { /* your case, typehint wasn't class name */ switch(cur_arg_info->type_hint) { case IS_ARRAY: //I stripped some lines here (insignificant) break; case IS_CALLABLE: //I stripped some lines here (insignificant) break; default: //<---- You error is here zend_error(E_ERROR, "Unknown typehint"); } } return 1; }

As you can see, for this error to occur, PHP should treat the typehint as not a class name, and, in the same time, as a something "unknown". That is why you cannot reproduce the error in regular case - because PHP will try to treat typehint as a class name firstly (so, error will be like "Argument {N} passed to {function()} must be an instance of {classname}")

The reason

So, while you cannot get such error in normal execution mechanism, you still can get some corrupted compiled files - and another hint is that you're using opcache. Thus, it may be because of you're evaluating some code in your method, which can cause corrupted compilation file - but that I can not say for sure. Another thing - it may be bug, which is inside opcache extension. But in any case, the reason is - wrong compilation which causes such error when VM tries to execute compiled script. And, since it can be resolved by clearing opcache (so, web-server resart) - I think that a reason is - that it's a bug.

So, TL;DR - I can not say the reason for sure, but can give some guidelines. Since this is too much for just comment, posting as an answer