smarty-php / smarty

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic.
Other
2.22k stars 701 forks source link

Referencing native php classes within namespace without define global namespace #1000

Closed digiwirtual closed 2 months ago

digiwirtual commented 2 months ago

Smarty 5.0.2 src/Runtime/ForeachRuntime.php Author @wisskid

Bug: class ForeachRuntime has defined namespace Smarty\Runtime but inside referencing php classes without giving global namespace, so classes are not accesible and code all the time just jump to the end of count function: return count((array)$value);

Using total in foreach loop on objects doesnt work.

Your code: obrazek

Fixed code: obrazek