#35767 [Opn->Bgs]: *printf argument swapping doesn't work with constants
| From: | capiCrimm at gmail dot com | Date: | Wed, 21 Dec 2005 20:40:05 +0000 |
| Subject: | #35767 [Opn->Bgs]: *printf argument swapping doesn't work with constants | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-90836@lists.php.net to get a copy of this message | ||
ID: 35767
User updated by: capiCrimm at gmail dot com
Reported By: capiCrimm at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
Operating System: WinXP/GNU Debian
PHP Version: 5CVS-2005-12-21 (snap)
New Comment:
I hate being stupid, the I was using forward slashes... :\
Previous Comments:
------------------------------------------------------------------------
[2005-12-21 21:38:28] capiCrimm at gmail dot com
Description:
------------
Using argument swapping with *printf you get a parse error thats the
same as if you included a variable in the string.
Reproduce code:
---------------
class Slaughter
{
const pig = "%1/$s is dead!";
public function __construct(){
printf(self::pig,'Oinker ');
}
}
new Slaughter;
Expected result:
----------------
Oinker is dead!
Actual result:
--------------
Parse error: parse error, unexpected '"' in <> on line <>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35767&edit=1