Skip to content

Conversation

@ner00
Copy link
Contributor

@ner00 ner00 commented Feb 27, 2025

The array_pop() function's parameter is passed "by reference", meaning the function directly modifies the variable that is passed into the function

case 1: $mbox = array_pop(explode('.', str_replace('INBOX.', '', $args['mailbox']))); break;

Due to this behaviour, you can't pass a function directly into array_pop(), you have to store the output of explode() into a variable first, then pass that variable into array_pop().

source: https://stackoverflow.com/a/45109918/924855

Note: also replaced indentation tabs with spaces, it was a mix of both.

The array_pop() function's parameter is passed 'by reference', meaning the function directly modifies the variable that is passed into the function (https://github.com/stremlau/html5_notifier/blob/5d85947e16ea9cac4544c59666fe0ff13ba2a44a/html5_notifier.php#L59). 

Due to this behaviour, you can't pass a function directly into array_pop(), you have to store the output of explode() into a variable first, then pass that variable into array_pop().

source: https://stackoverflow.com/a/45109918/924855
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.

1 participant