php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #28859 sscanf optional parameters causes warning
Submitted: 2004-06-20 22:10 UTC Modified: 2004-06-21 09:36 UTC
From: wetstreams at yahoo dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.7 OS: windows 2000
Private report: No CVE-ID: None
 [2004-06-20 22:10 UTC] wetstreams at yahoo dot com
Description:
------------
If you copy the example below from the manual, and run with 

error_reporting  =  E_ALL in php.ini

you get the result below.

Reproduce code:
---------------
<!-- Example 2 from http://us2.php.net/sscanf -->

<html><body>
<?php
// get author info and generate DocBook entry
$auth = "24\tLewis Carroll";
$n = sscanf($auth, "%d\t%s %s", &$id, &$first, &$last);
echo "<author id='$id'>
    <firstname>$first</firstname>
    <surname>$last</surname>
</author>\n";

?>
</body></html>

Expected result:
----------------
I expected the example from the documentation to work.

Actual result:
--------------
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of sscanf(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in c:\inetpub\www\xxx\testsscanf.php on line 5

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of sscanf(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in c:\inetpub\www\xxx\testsscanf.php on line 5

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of sscanf(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in c:\inetpub\www\xxx\testsscanf.php on line 5
Lewis Carroll 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-20 22:57 UTC] rasmus@php.net
This is a simple documentation problem.  The &'s should be removed from that example.
 [2004-06-21 09:36 UTC] betz@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:12 UTC] phpdocbot@php.net
Automatic comment on behalf of betz
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=17c0ff93b45bf60027402abca0f3e9d395f1cc39
Log: bugfix #28859 Call-time pass-by-reference has been deprecated
 [2020-12-30 12:47 UTC] nikic@php.net
Automatic comment on behalf of blindman
Revision: http://git.php.net/?p=doc/ru.git;a=commit;h=21838f06f7e05d26e1d28ee19312cce468121c74
Log: sync with EN (fix #28859)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 19 09:00:01 2025 UTC