Error: Assignment of read-only location in C
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Consider this example:
Output
Here, the statement str[0]='p' will try to change the first character of the string, thus, the "Error: assignment of read-only location" will occur.
How to fix?
Do not change the value of a constant during program execution.
need an explanation for this answer? contact us directly to get an explanation for this answer