3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code = <<<TWIG (function (Translator) { {% if include_config %} Translator.fallback = '{{ fallback }}'; Translator.defaultDomain = '{{ defaultDomain }}'; {% endif %} {% for locale, domains in translations %} // {{ locale }} {% for domain, messages in domains %} {% for key, message in messages %} Translator.add({{ key|json_encode|raw }}, {{ message|json_encode|raw }}, "{{ domain }}", "{{ locale }}"); {% endfor %} {% endfor %} {% endfor %} })(Translator); TWIG; preg_match_all('/(\{\{|\{%|\{\#)(\-)?/s', $code, $matches, PREG_OFFSET_CAPTURE); var_dump($matches[2]);
Output for git.master, git.master_jit, rfc.property-hooks
array(15) { [0]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [1]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [2]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [3]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [4]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [5]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [6]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [7]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [8]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [9]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [10]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [11]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [12]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [13]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } [14]=> array(2) { [0]=> string(0) "" [1]=> int(-1) } }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
106.75 ms | 409 KiB | 5 Q