|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-11-28 20:58 UTC] sniper@php.net
[2003-11-29 01:21 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 20 06:00:02 2025 UTC |
Description: ------------ Smarty uses a rather complex variable method name replacement system. In the "compiled" Smarty templates there is code like this: $this->_plugins['function']['assign'][0](/* params */) Which works fine in PHP4, but PHP5 issues a fatal error: "Fatal error: Method name must be a string" Is this a PHP5 bug or an abuse of PHP syntax (and therefore a Smarty bug)? Reproduce code: --------------- A Smarty compiled template: <?php $this->_load_plugins(array( array('function', 'assign', 'sql/db-init/Control.tpl', 1, false),)); ?><?php echo $this->_plugins['function']['assign'][0](array('var' => 'fname','value' => "sql/db-init/".$this->_tpl_vars['targetDatabase']."/createdb.tpl"), $this) ; ?> <?php $_smarty_tpl_vars = $this->_tpl_vars; $this->_smarty_include($this->_tpl_vars['fname'], array()); $this->_tpl_vars = $_smarty_tpl_vars; unset($_smarty_tpl_vars); ?> ~ Expected result: ---------------- No error. Actual result: -------------- Fatal error: Method name must be a string in templates_c/%%-16/%%-1662958972/Control.tpl.php