Reputation: 35
Using PHP I'm trying to parse very large xml files and insert them into mysql database, while this has been working more than fine for months now, I have decided that I want the script to start collecting some data from the xml along the way and storing it in an array that I can process later on in the script, the server I'm using is a dedicated server with 3GB RAM and I thought it would easily be able to store the needed information in a standard array provided I set the memory_limit to 2500MB, it shouldnt even get anywhere near it, only to find out that PHP's arrays are extremely inefficient with memory usage and towards that end of the script running it's hitting the limit and the script stops running.
After searching I have came accross Something Called SplFixedArray that I thought I would try, however all documentation says that all I need to do to use one is
$array = new SplFixedArray(5);
only when I try to use this I get this error when trying to run it
PHP Fatal error: Class 'SplFixedArray' not found in /home/rob/testscript.php on line 6
I've looked everywhere including php.net and I can't seem to find out why it can't find it. Am I missing something?
Upvotes: 1
Views: 429
Reputation: 1497
This issue is that your PHP installation is too old.
Update to a newer version than 5.3 and you'll have all working :)
Upvotes: 2