Skip to content

[bug fix] PHP Warning: Cannot assign an empty string to a string offset and different result of comparation of two string#2

Open
trioputrap wants to merge 1 commit intoiugrina:masterfrom
trioputrap:master
Open

[bug fix] PHP Warning: Cannot assign an empty string to a string offset and different result of comparation of two string#2
trioputrap wants to merge 1 commit intoiugrina:masterfrom
trioputrap:master

Conversation

@trioputrap
Copy link
Copy Markdown

This is a simple update to fix the issue about compare A to B doesn't equal B to A. This update also fix the "PHP Warning: Cannot assign an empty string to a string offset" on line 60 => $temp_string2[$j] = ''; because can not insert empty character ('') to a string.

Copy link
Copy Markdown

@se8820726 se8820726 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

str_plit is incorrect
str_split is true

$temp_string2 = str_plit($string2); => $temp_string2 = str_split($string2);

@trioputrap
Copy link
Copy Markdown
Author

Thank you! I mistyped the str_split

$str1_len = strlen($string1);
$str2_len = strlen($string2);
$temp_string2 = $string2;
$temp_string2 = str_plit($string2);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo function name here

$temp_string2 = str_split($string2);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants