Skip to content

Conversation

dat-mc
Copy link
Contributor

@dat-mc dat-mc commented Sep 26, 2021

In some cases, the index of the first element of the array ($array[0]) is missing and we get a Notice: Undefined offset: 0
For example an array can start at index 2, so use array_key_first() function.

Try this:

quicksort([4, 5, 2, 3, 100, 1, 90, 12, 10, 23]);

@egonSchiele egonSchiele merged commit c91f1ad into egonSchiele:master Nov 18, 2022
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.

2 participants