🏆 A full-stack component-based MVC kernel for PHP that helps you write powerful and modern web applications. Write less, have cleaner code and your work will bring you joy.
When you declare persistent variable of int|null type inside of Control, and in URL coresponding parameter is empty string, than type error occurs. From what I've learnt this error happens in ComponentReflection in castScalar() method when you try to check whether data-loss happens. It seems that this peace of code does not count with nullable persistent parameters. It happens because strict typed comparassion.
I would expect that when there is given an empty string in GET/POST, and declared coresponding persistent variable is nullable, than 'null' should be assigned. If it makes sence.
Hey there,
When you declare persistent variable of int|null type inside of Control, and in URL coresponding parameter is empty string, than type error occurs. From what I've learnt this error happens in ComponentReflection in castScalar() method when you try to check whether data-loss happens. It seems that this peace of code does not count with nullable persistent parameters. It happens because strict typed comparassion.
I would expect that when there is given an empty string in GET/POST, and declared coresponding persistent variable is nullable, than 'null' should be assigned. If it makes sence.
Tested on version: 3.1.17.