-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong example or description for "segment" method? #8
Comments
I think I know myself. Edit:
...and found that it uses the index with a value "-1". Well, now I don't understand. |
The example with 3 parameters is a mistake, probably a remnant of an older version of the package. The correct usage is:
(if I'd write this again, I'd probably use a 1-based index, and disallow querying for the 0 segment) |
Thank you for the explanation. |
Why in description of method SEGMENT has two parameters, but one of the examples has three parameters? "->segment('/', 0, true)"
Method description:
Example:
string('foo/bar/baz')->segment('/', 0, true); // baz <-- 3 parameters
Why do not use:
string('foo/bar/baz')->segment('/', -1); // baz
The text was updated successfully, but these errors were encountered: