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.
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](https://github.com/smarty-php/smarty/assets/5253962/662f9e84-a0e1-46dd-9bd2-e4bd7eec9b9d)
Fixed code:![obrazek](https://github.com/smarty-php/smarty/assets/5253962/97d5d39a-7eb0-435b-bbff-e976ffefc9b5)