note 77851 deleted from function.define by cmb
| From: | cmb@php.net | Date: | Sun, 06 Oct 2019 07:46:02 +0000 |
| Subject: | note 77851 deleted from function.define by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212464@lists.php.net to get a copy of this message | ||
Note Submitter: rayro at gmx dot de
----
just a note to the previous post by e s lin d sey at g mail dot co m:
Well as u said, it is not the best workaround. To resolve this "Problem" without getting
incredible loss of performance, you are able to make the use of "variable functions" like
"variable variables":
<?php
$def = 'constant';
$string = <<<END
This is PHP running on<br />
{$def('PHP_OS')}
END;
var_dump($string);
?>
In this example we make use of the "constant" function which is builtin, and it will
output:
string(37) " This is PHP running on
WINNT"
Tested on PHP 5...
Best regards