Jump to content

Using SPL Data Structures


kaujot

Recommended Posts

Hi,

 

I'm trying to implement a doubly linked list as described by SPL. This is my code:

 

<?php

$list = new SplDoublyLinkedList();

?>

 

That's how they create a list in the manual, so, in theory, it's correct. However, I receive this error:

 

 

Fatal error: Class 'SplDoublyLinkedList' not found in /var/www/joomla/trunk/components/com_camps/views/camp/tmpl/default.php on line 61

 

My system is running PHP 5.2.4, and the docs tell me that the SPL extension is available and compiled by default in PHP 5.0.0. However, I haven't been able to find any information at all on how to access the data structures that I really need to implement?

 

Anyone know?

 

Thanks so much.

Link to comment
Share on other sites

Have you checked out phpinfo to make sure spl is available?

 

Yes, it is, though the DoublyLinkedList is among the classes that phpinfo says are available to SPL. Is there some later version I'm missing? I didn't see anything in the documentation to make me think that DDLs were only available to a certain version of SPL, though I could have easily missed that.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.