smarty icon indicating copy to clipboard operation
smarty copied to clipboard

in version 3.1.29 bug for PHP 7

Open great-handsome opened this issue 10 years ago • 3 comments

i think it bug in PHP 7. in dev-master file sysplugins/smarty_internal_templatecompilerbase.php line 735 return $this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ][ 0 ]->$function[ 1 ]($args,

line 676 return $this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ][ 0 ]->$function[ 1 ]($new_args,

php.net/manual/en/migration70.incompatible.php

Expression $foo->$bar['baz']()
PHP 5 interpretation $foo->{$bar['baz']}()
PHP 7 interpretation ($foo->$bar)['baz']() 

great-handsome avatar Jun 09 '16 09:06 great-handsome

You are wrong as there is no variable class variable like $bar

uwetews avatar Jul 11 '16 21:07 uwetews

I don't understand how is it will be work in PHP 7 without a changes. Code for PHP 5: line 735 return $this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ][ 0 ]->$function[ 1 ]($args, line 676 return $this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ][ 0 ]->$function[ 1 ]($new_args,

I think for PHP 7 needs code ( added { , } ) return $this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ][ 0 ]->{$function[ 1 ]}($args, line 676 return $this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ][ 0 ]->{$function[ 1 ]}($new_args,

great-handsome avatar Jul 12 '16 10:07 great-handsome

Sorry, yes you have been absolutely right. The fix is in the master branch

uwetews avatar Jul 12 '16 22:07 uwetews