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]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lvdlR
function name:  (null)
number of ops:  12
compiled vars:  !0 = $code, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%28function+%28Translator%29+%7B%0A++++%7B%25+if+include_config+%25%7D%0A++++++++Translator.fallback++++++%3D+%27%7B%7B+fallback+%7D%7D%27%3B%0A++++++++Translator.defaultDomain+%3D+%27%7B%7B+defaultDomain+%7D%7D%27%3B%0A++++%7B%25+endif+%25%7D%0A++++%7B%25+for+locale%2C+domains+in+translations+%25%7D%0A++++++++%2F%2F+%7B%7B+locale+%7D%7D%0A++++++++%7B%25+for+domain%2C+messages+in+domains+%25%7D%0A++++++++++++%7B%25+for+key%2C+message+in+messages+%25%7D%0A++++++++++++++++Translator.add%28%7B%7B+key%7Cjson_encode%7Craw+%7D%7D%2C+%7B%7B+message%7Cjson_encode%7Craw+%7D%7D%2C+%22%7B%7B+domain+%7D%7D%22%2C+%22%7B%7B+locale+%7D%7D%22%29%3B%0A++++++++++++%7B%25+endfor+%25%7D%0A++++++++%7B%25+endfor+%25%7D%0A++++%7B%25+endfor+%25%7D%0A%7D%29%28Translator%29%3B'
   20     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%28%5C%7B%5C%7B%7C%5C%7B%25%7C%5C%7B%5C%23%29%28%5C-%29%3F%2Fs'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        SEND_VAL                                                 256
          6        DO_ICALL                                                 
   22     7        INIT_FCALL                                               'var_dump'
          8        FETCH_DIM_R                                      ~4      !1, 2
          9        SEND_VAL                                                 ~4
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.33 ms | 1395 KiB | 17 Q