I am trying to compare two arrays. Using array_intersect is not a problem. When using array_diff and arrays with ~ 5000 values, it works. When I get ~ 10,000 values, the script dies when I get the diff array. Enabling error_reporting did nothing.
I tried to create my own array_diff function:
function manual_array_diff($arraya, $arrayb) { foreach ($arraya as $keya => $valuea) { if (in_array($valuea, $arrayb)) { unset($arraya[$keya]); } } return $arraya; }
source: How does array_diff work?
I would expect it to be less efficient than the official array_diff, but it can handle arrays of size ~ 10,000. Unfortunately, both array_diffs fail when I get to ~ 15,000.
I tried the same code on another machine and it works fine, so this is not a problem with the code or PHP. There must be some limit on this particular server. Any idea how I can get around this restriction or change it or just find out what it is?
php
burger
source share