Strange behavior of Yii, when the code is encoded ionCube
Rate Topic:

When the project is encoded using ioncube works incorrectly binding parameters to the action ($ var1 = 22, $ var2 = null) - if you call a controller action with no parameters, then an error is "invalid request".

Encoding is carried out the project with default settings ioncube. Maybe someone knows, which is why this is happening?

I checked, this problem occurs only if the ReflectionParameter()->isDefaultValueAvailable() is used from an external unencrypted code that is out of the framework.

I also coded framework and the problem disappeared.

This is related to how the PHP engine implements default parameter reflection. There's no meta data holding details of default parameters for reflection purposes, so to obtain default parameter details, the PHP engine has to resort to what is arguably a kludge of scanning the compiled bytecode to find the necessary information from the v'machine instructions related to parameter passing. ionCube compiled bytecode is protected, so the regular PHP engine bytecode searching fails when it encounters ionCube compiled code due to it not being understood. The ionCube Loader for processing encoded files contains an execution engine designed to ensure that the reflection operations on default values *are* able to work on encoded files, which is why the behaviour works as expected when the calling code was encoded.

In Yii2 you need to copy \yii\web\Controller::bindActionParams to your encoded web controller, and for the console controller: \yii\console\Controller::getActionArgsHelp and \yii\console\Controller::bindActionParams .