Welcome Guest, Not a member yet? Register   Sign In
Unable to use typed variables in a cell
#6

(This post was last modified: 05-30-2024, 08:13 AM by Fabio-Zeus-Soft.)

(05-30-2024, 05:21 AM)kenjis Wrote: Try:
PHP Code:
class JustATestCell extends Cell
{
    public $typedVariable;

or
PHP Code:
class JustATestCell extends Cell
{
    public int $typedVariable 0;


This is due to the behavior of get_object_vars().
See https://www.php.net/manual/ja/function.g...php#127940

This was pretty cool, good job, many thanks, much appreciated!
Could be useful then to use the Reflection API to improve this function?
I mean CodeIgniter\Traits\PropertiesTrait->getPublicProperties(), instead of relying on get_object_vars() should leverage the advantages of the Reflection API over get_object_vars()
Reply


Messages In This Thread
RE: Unable to use typed variables in a cell - by Fabio-Zeus-Soft - 05-30-2024, 07:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB