-
-
Save jonasporto/54b09af1fae2f1e8e3873d7091cde662 to your computer and use it in GitHub Desktop.
How to call a PHP function inside a Heredoc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$cb = function ($fn) { | |
return $fn; | |
}; | |
echo <<<HEREDOC | |
Hello, {$cb(ucfirst('world'))} | |
HEREDOC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment