php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23390 similar_text() requires reference but generates warning
Submitted: 2003-04-28 17:02 UTC Modified: 2003-04-28 17:11 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: phpbugs at localpin dot com Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 4.3.1 OS: Windows XP Home Edition
Private report: No CVE-ID: None
 [2003-04-28 17:02 UTC] phpbugs at localpin dot com
(I think this is supposed to be fixed 'in CVS' whatever that means, but just in case...)

similar_text() requires a parameter by reference but generates a warning for doing so!  My log file is thus packed with warnings as follows, and I must switch off the php.ini setting which warns about such things.

[Mon Apr 28 23:37:25 2003] [error] PHP 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 similar_text(). 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.  

I am told to "modify the declaration of similar_text()", a PHP function!

I would suggest that if PHP is deprecating pass-by-reference:
- this function be changed ASAP
- this function (and any others) that are part of PHP and use reference variables do not issue a warning
- at the very least, a note in the documentation for similar_text() about this.

It is my aim (and the general aim of good programming I suppose) to log and fix ALL errors, but this one makes this aim impossible unless I switch this error off completely!

Thanks!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-28 17:11 UTC] moriyoshi@php.net
<?php
similar_text('foo', 'fubar', $sim);
echo $sim;
?>

will do; No "&" is needed in the third parameter.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 15:01:32 2024 UTC