|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55640 Functionality of 'from' and 'len' as arrays is not implemented
Submitted: 2011-09-08 10:54 UTC Modified: 2013-02-18 00:35 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: dmitry dot sychov at gmail dot com Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.3.8 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
47 - 2 = ?
Subscribe to this entry?

 [2011-09-08 10:54 UTC] dmitry dot sychov at gmail dot com
From manual page:

I'am getting: "Functionality of 'from' and 'len' as arrays is not implemented"
when trying to pass arrays as per documentation.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-13 22:17 UTC]
-Status: Open +Status: Feedback
 [2011-09-13 22:17 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

 [2011-10-10 14:45 UTC] rintaun at projectxero dot net
    echo substr_replace('abcde', 'f', array(0, 1), array(1, 1));

Expected output:

Actual output: 
    Warning: substr_replace(): Functionality of 'from' and 'len' as
    arrays is not implemented in - on line 2
 [2011-12-12 15:35 UTC] send_no_hormel at hotmail dot com
I agree that it'd be very nice if one could pass a buffer as the input string, with arrays of offsets, lengths, and replacement strings (which is something I need to accomplish), but per the documentation, use of arrays for the replacement, offset, and lengths are only valid if the input string itself is passed as an array, and in that case, this function will return an array, not a string.

This is best categorized as a desired functionality, but it's not a bug.
 [2013-02-18 00:35 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 08:01:33 2024 UTC