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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nvktknnv at objectmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 23:01:29 2025 UTC