[php-src] Issue #11660: template

From: Date: Mon, 10 Jul 2023 11:53:03 +0000
Subject: [php-src] Issue #11660: template
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-244929@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/11660 Author: SVGAnimate ### Description Hello, Is it possible to support code template in PHP ? <hr /> As a prerequisite I have: ```PHP <?php // file: index.php require_once "defs.php"; // declare function func_1() func_1(); ``` Currently I do: ```PHP <?php // file: macro.php function MY_DEFINE_MACRO($name) {?> function <? $name ?>() { echo "<? $name ?>\n"; } <?php} MY_DEFINE_MACRO("func_1"); MY_DEFINE_MACRO("func_2"); MY_DEFINE_MACRO("func_3"); ``` ```console user@home:~$ php macro.php >> defs.php && php index.php func_1 ``` <hr /> I would like to do : ```PHP <?php // file: index.php require_once "defs.php"; // declare template MY_DEFINE_MACRO<> MY_DEFINE_MACRO<func_1>(); ``` ```console user@home:~$ php index.php func_1 ``` <hr /> Basically, I would like to make macros in PHP - Hypertext **Preprocessor** (which would be consistent for a recursive acronym)

« previous php.bugs (#244929) next »