Download Latest Version Mustache.php v3.2.0 source code.zip (69.8 kB) Google Add to Preferred Sources
Home / v3.2.0
Name Modified Size InfoDownloads / Week
Parent folder
Mustache.php v3.2.0 source code.tar.gz 2026-05-10 45.4 kB
Mustache.php v3.2.0 source code.zip 2026-05-10 69.8 kB
README.md 2026-05-10 2.1 kB
Totals: 3 Items   117.3 kB 0

This release fixes a longstanding inheritance spec compliance bug, adds opt-in strict handling for missing tags, hardens filesystem template loading, and improves rendering diagnostics.

New:

  • Add debug_rendering, an engine option for capturing the active Mustache tag stack when rendering fails. Use DEBUG_RENDERING_ON_EXCEPTION to retry failed renders with debug traces, or DEBUG_RENDERING_ALWAYS to compile traces into every render.
  • Add strict_tags, a bitmask-based engine option for treating missing interpolation values, sections, partials, parent templates, and extra block overrides as failures.

Improved:

  • Fix a longstanding inheritance spec compliance bug with nested parent templates. Nested layouts can now safely reuse common block names like content; overrides stay scoped to the parent they belong to instead of leaking outward and causing surprising recursion.
  • Harden FilesystemLoader against path traversal and null-byte template names, including dynamic partial and parent names.
  • Non-stringable output failures now throw clear exceptions. Defaults match previous Mustache.php behavior, but strict_tags can now relax coercion to render these values as empty strings.
  • Context lookup now respects method visibility. Private and protected methods are treated as missing values rather than throwing exceptions.
  • README and repository metadata cleanup. Thanks @michaelwood and @reedy.

Heads up:

  • DEBUG_RENDERING_ALWAYS adds trace collection to every render, with up to 25% overhead. It is useful in development, but probably not what you want all the time.
  • DEBUG_RENDERING_ON_EXCEPTION keeps successful renders fast and only pays the tracing cost after a failure. Failed templates render twice, so watch out for side effects in lambdas, helpers, or custom escaping callbacks. You don't have those in your data model, right? Right?

[!NOTE] FilesystemLoader now rejects template names that resolve outside the configured base directory. To preserve the old behavior, pass allow_unsafe_template_names => true. This is not recommended.

Source: README.md, updated 2026-05-10