Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in version 3.1.29 bug for PHP 7 #241

Closed
great-handsome opened this issue Jun 9, 2016 · 3 comments
Closed

in version 3.1.29 bug for PHP 7 #241

great-handsome opened this issue Jun 9, 2016 · 3 comments

Comments

@great-handsome
Copy link

great-handsome commented Jun 9, 2016

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']() 
@uwetews
Copy link
Contributor

uwetews commented Jul 11, 2016

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

@uwetews uwetews closed this as completed Jul 11, 2016
@great-handsome
Copy link
Author

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,

@uwetews
Copy link
Contributor

uwetews commented Jul 12, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants