my php is update from php 5.4 to php 7.0.33 , but php code get an error with Dynamic variables
php 5.4 some code like this...
$attributes=array('boy','girl','none' );
$this->boy = 'eric';
$this->girl = 'lili';
$this->none = 'who';
echo $attributes[0]; //=>php 5 is "boy" | php 7 is "boy"
print_r( $this->$attributes[0] ); //=>php 5 is "eric" | php 7 is empty
print_r( $this->${attributes}[0] ); //=>php 5 is "eric" | php 7 is empty
when I use in php 7 shome code get epmty, how can I do to resolve this problem
I already watching the refer page Using braces with dynamic variable names in PHP , but still confused