[PHP-NOTES] note 130677 added to language.variables.variable

[email protected] ("[email protected]") Mon, 09 Mar 2026 01:47:29 +0000
Newsgroups php.notes
Message-ID <[email protected]>
there is a comment, that this does not work:
<?php
      $foo = 'info';
      {"php$foo"}(); // Parse error
?>

however this works (at least as tested in 8.3.30):
<?php
      $foo = 'info';
      "php$foo"(); // works
?>
----
Server IP: 206.189.2.9
Probable Submitter: 2003:dd:b74c:d600:baff:f9bc:1484:2d3
----
Manual Page -- https://php.net/manual/en/language.variables.variable.php
Edit        -- https://main.php.net/note/edit/130677
Del: integrated  -- https://main.php.net/note/delete/130677/integrated
Del: useless     -- https://main.php.net/note/delete/130677/useless
Del: bad code    -- https://main.php.net/note/delete/130677/bad+code
Del: spam        -- https://main.php.net/note/delete/130677/spam
Del: non-english -- https://main.php.net/note/delete/130677/non-english
Del: in docs     -- https://main.php.net/note/delete/130677/in+docs
Del: other reasons-- https://main.php.net/note/delete/130677
Reject      -- https://main.php.net/note/reject/130677
Search      -- https://main.php.net/manage/user-notes.php