Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

is it bug?

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
handsome
Smarty Rookie


Joined: 30 May 2016
Posts: 6

PostPosted: Mon May 30, 2016 4:49 am    Post subject: is it bug? Reply with quote

Hi.

For PHP 7 is it bug "->$function[ 1 ]($args,$this);"?

Smarty3_1_29\sysplugins\smarty_internal_templatecompilerbase.php

} elseif (is_object($function[ 0 ])) {
return $this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ][ 0 ]->$function[ 1 ]($new_args,
$this);
}

......................

} elseif (is_object($function[ 0 ])) {
return $this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ][ 0 ]->$function[ 1 ]($args,$this);
}

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

Expression $foo->$bar['baz']()

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

PHP 7 interpretation ($foo->$bar)['baz']()

--------------------------------
not work webmaster@smarty.net
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

webmaster@smarty.net
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1406

PostPosted: Mon May 30, 2016 3:13 pm    Post subject: Reply with quote

Check Smarty dev/master.
Also, WHICH PHP5? If it's 5.3, then you're seriously out of date. 2 years off at least.
Back to top
View user's profile Send private message
handsome
Smarty Rookie


Joined: 30 May 2016
Posts: 6

PostPosted: Tue May 31, 2016 6:59 am    Post subject: Reply with quote

in Smarty3_1_29\sysplugins\smarty_internal_templatecompilerbase.php
i see
..................
return $this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ][ 0 ]->$function[ 1 ]($args,

...................

return $this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 0 ][ 0 ]->{$function[ 1 ]}($new_args,
.....................
Back to top
View user's profile Send private message
handsome
Smarty Rookie


Joined: 30 May 2016
Posts: 6

PostPosted: Mon Jun 06, 2016 4:34 am    Post subject: Reply with quote

AnrDaemon wrote:
Check Smarty dev/master.
Also, WHICH PHP5? If it's 5.3, then you're seriously out of date. 2 years off at least.

where i can look for dev version of smarty?
Also i not sure what you mean when say 5.3 and out of date, when i talk about php5 to php7 migration and about code that will work different in two major php versions
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1406

PostPosted: Mon Jun 06, 2016 11:20 am    Post subject: Reply with quote

composer require smarty/smarty dev-master

handsome wrote:
Also i not sure what you mean when say 5.3 and out of date, when i talk about php5 to php7 migration
You didn't specify, which "PHP5".
The difference between 5.3 and 5.4 for example is quite significant. The code written for 5.4 will never run on 5.3, the syntax is just not compatible.
Back to top
View user's profile Send private message
handsome
Smarty Rookie


Joined: 30 May 2016
Posts: 6

PostPosted: Tue Jun 07, 2016 6:18 am    Post subject: Reply with quote

AnrDaemon wrote:
composer require smarty/smarty dev-master

handsome wrote:
Also i not sure what you mean when say 5.3 and out of date, when i talk about php5 to php7 migration
You didn't specify, which "PHP5".
The difference between 5.3 and 5.4 for example is quite significant. The code written for 5.4 will never run on 5.3, the syntax is just not compatible.

Are you read my first message?
I SAY ABOUT PHP 7!!!!
line like this
return $this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ][ 0 ]->$function[ 1 ]($args,$this);
that will work different in two php versions: PHP 5 and PHP 7.
Why is it not fixed in smarty version 3.1.29?

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

Expression $foo->$bar['baz']()

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

PHP 7 interpretation ($foo->$bar)['baz']()
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1406

PostPosted: Tue Jun 07, 2016 10:33 pm    Post subject: Reply with quote

Because 3.1.29 is not the head of the development?…
Check the dev-master.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1406

PostPosted: Tue Jun 07, 2016 10:34 pm    Post subject: Reply with quote

handsome wrote:
Why is it not fixed in smarty version 3.1.29?
Because 3.1.29 is not the head of the development?…
Check the dev-master.
Back to top
View user's profile Send private message
handsome
Smarty Rookie


Joined: 30 May 2016
Posts: 6

PostPosted: Thu Jun 09, 2016 5:07 am    Post subject: Reply with quote

AnrDaemon wrote:
Because 3.1.29 is not the head of the development?…
Check the dev-master.


after run composer require smarty/smarty dev-master
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,

what is the problem fix it?
AnrDaemon, you have written stupid 3 posts and you have not checked the bug in the Dev-master, where is really smart developers?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1406

PostPosted: Thu Jun 09, 2016 7:24 am    Post subject: Reply with quote

1. I have my own work, which feed me. It takes time to do it.
2. I didn't experience this issue myself and I have no setup to replicate it.
3. I have no immediate interest in it, given #2.
4. I'm not oblidged to run on your call.

Nonetheless, I thank you for your report and a final check against current master branch, after a week of complaining…
I'm sure Smarty developers will notice and fix the issue.

P.S.
Next time, if you need help, or if you want to help, then communicate like an adult person, not like a little spoiled child.
Back to top
View user's profile Send private message
handsome
Smarty Rookie


Joined: 30 May 2016
Posts: 6

PostPosted: Thu Jun 09, 2016 9:20 am    Post subject: Reply with quote

AnrDaemon, you have shown themselves like a foolish man, you do not need to continue to do so. You can't read message but writes the answer, i don't know may be you can not read. ))
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5067
Location: Hamburg / Germany

PostPosted: Thu Sep 15, 2016 5:01 am    Post subject: Reply with quote

This Smarty code had no PHP7 incompatibility problem at all.
The problem was with an expression like $foo->$bar['baz']() .
An expression like $foo['bar']->$bar['baz']() like used in Smarty does not have that problem.
Smarty is passing all PHPunit tests on PHP7.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP