Voting

: max(one, four)?
(Example: nine)

The Note You're Voting On

nopy at users dot sourceforge dot net
21 years ago
Just a warning that re-indexing an array by array_values() may cause you to reach the memory limit unexpectly.

For example, if your PHP momory_limits is 8MB,
and says there's a BIG array $bigArray which allocate 5MB of memory.

Doing this will cause PHP exceeds the momory limits:

<?php
$bigArray
= array_values( $bigArray );
?>

It's because array_values() does not re-index $bigArray directly,
it just re-index it into another array, and assign to itself later.

<< Back to user notes page

To Top