php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53497 vprintf returns size of formatted string and not the string as sprintf does
Submitted: 2010-12-08 13:07 UTC Modified: 2010-12-08 13:12 UTC
From: nvktknnv at objectmail dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 5.3.3 OS: Windows 7 x64
Private report: No CVE-ID: None
 [2010-12-08 13:07 UTC] nvktknnv at objectmail dot com
Description:
------------
PHP 5.3.3 (cli) (built: Jul 21 2010 20:10:20)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans

The example should return a single row of text. Instead running it on Win7 x64 with the CLI of php it returns the result shown below.

Test script:
---------------
<?php
	$formatted = vprintf("Some text: %s", array(12344));
	echo "\n\nOut: $formatted\n";
?>

Expected result:
----------------
Out:Some text: 12344

Actual result:
--------------
Some text: 12344


Out: 16

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-08 13:12 UTC] nvktknnv at objectmail dot com
-Status: Open +Status: Closed
 [2010-12-08 13:12 UTC] nvktknnv at objectmail dot com
cant read. sry.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 23:01:29 2024 UTC