Location: PHPKode > scripts > Singly Linked List > singly-linked-list/listtest.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<?php
include("includes/classes/linkedlist.php");

$list = new LinkedList();
$list->addData(1);
$list->setNext(2);

echo $list->getData();
echo '<br>';
$next = $list->getNext();
echo $next->getData();
?>
</body>
</html>
Return current item: Singly Linked List