Unexpected End of File Error at the end of the file
<p>I am having an issue when running the sample code below. It said: " Syntax error, Unexpected end of file" at the end of the codes. Can someone help me? 
I also don't understand that whether or not <code>&lt;? ?&gt;</code> works the same way as <code>&lt;?php ?&gt;</code>.
thanks</p>

<pre><code>    &lt;?php 
    /**
     * @copyright Copyright (C) DocuSign, Inc.  All rights reserved.
     *
     * This source code is intended only as a supplement to DocuSign SDK
     * and/or on-line documentation.
     * This sample is designed to demonstrate DocuSign features and is not intended
     * for production use. Code and policy for a production application must be
     * developed to meet the specific data and security requirements of the
     * application.
     *
     * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
     * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
     * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
     * PARTICULAR PURPOSE.
     */

    /*
     * Lists status of all envelopes in an account
     */

    //========================================================================
    // Includes
    //========================================================================
    include_once 'include/session.php'; // initializes session and provides
    include_once 'api/APIService.php';
    include 'include/utils.php';

    //========================================================================
    // Functions
    //========================================================================
    function createStatusTable() {
        $count = count($_SESSION["EnvelopeID"]);
        if (isset($_SESSION["EnvelopeID"]) &amp;&amp; count($_SESSION["EnvelopeID"]) &gt; 0) {
            $api = getAPI();

            $filter = new EnvelopeStatusFilter();
            $filter-&gt;AccountId = $_SESSION["AccountID"];
            $filter-&gt;EnvelopeIds = $_SESSION["EnvelopeID"];
            try {
                $rsexParams = new RequestStatusesEx();
                $rsexParams-&gt;EnvelopeStatusFilter = $filter;
                $statuses = $api-&gt;RequestStatusesEx($rsexParams)-&gt;RequestStatusesExResult;
            } catch (SoapFault $e) {
                $_SESSION["errorMessage"] = $e;

                header("Location: error.php");
            }

            if (isset($statuses)) {
                pr($statuses);
                ?&gt; &lt;ul class=""&gt; &lt;?
                foreach ($statuses-&gt;EnvelopeStatuses-&gt;EnvelopeStatus as $status) {
                   ?&gt;
                        &lt;li&gt;
                            &lt;span&gt;&lt;u&gt;&lt;?= $status-&gt;Subject ?&gt;&lt;/u&gt; 
                                [ &lt;?= $status-&gt;Status ?&gt; ] - 
                                &lt;?= $status-&gt;EnvelopeID; ?&gt; 
                                &lt;a href="getstatusofenvelope.php?envelopeid=&lt;?= $status-&gt;EnvelopeID; ?&gt;" target="_blank" title="Click to see a RequestStatus SOAP return for this Envelope"&gt;View RequestStatus&lt;/a&gt;
                                &amp;nbsp;&amp;nbsp;&lt;a href="getpdf.php?envelopeid=&lt;?= $status-&gt;EnvelopeID; ?&gt;" target="_blank" title="Click to download PDF for this Envelope"&gt;Download PDF&lt;/a&gt;&lt;/span&gt;
                            &lt;ul&gt;
                                &lt;!-- Recipients --&gt;
                                &lt;li&gt;
                                    &lt;span&gt;Recipients ( &lt;?= count($status-&gt;RecipientStatuses-&gt;RecipientStatus); ?&gt; )&lt;/span&gt;
                                    &lt;ul id="&lt;?= $status-&gt;EnvelopeID; ?&gt;"&gt;

                                        &lt;? foreach($status-&gt;RecipientStatuses-&gt;RecipientStatus as $rcpStatus){ ?&gt;
                                                    &lt;li&gt;
                                                        &lt;!-- Recipient Name and Start Signing --&gt;
                                                        &lt;?
                                                            echo $rcpStatus-&gt;UserName;
                                                        ?&gt; 
                                                        &lt;a href="embeddocusign.php?from_gsad=1&amp;envelopeID=&lt;?= $status-&gt;EnvelopeID; ?&gt;&amp;clientID=&lt;?= $rcpStatus-&gt;ClientUserId ?&gt;"&gt;Start Signing&lt;/a&gt;
                                                    &lt;/li&gt;
                                        &lt;? } ?&gt;

                                    &lt;/ul&gt;
                                &lt;/li&gt;


                                &lt;!-- Documents --&gt;
                                &lt;li&gt;
                                    &lt;span&gt;Documents ( &lt;?= count($status-&gt;DocumentStatuses-&gt;DocumentStatus); ?&gt; )&lt;/span&gt;
                                    &lt;ul&gt;
                                        &lt;? foreach($status-&gt;DocumentStatuses-&gt;DocumentStatus as $docStatus){ ?&gt;
                                                &lt;li&gt;
                                                    &lt;?= $docStatus-&gt;Name; ?&gt;
                                                &lt;/li&gt;
                                        &lt;? } ?&gt;
                                    &lt;/ul&gt;
                                &lt;/li&gt;

                            &lt;/ul&gt;
                        &lt;/li&gt;
                   &lt;?
                    };
                ?&gt; &lt;/ul&gt; &lt;?
            }
        } else {
          // No Envelopes created yet
                echo '&lt;tr&gt;&lt;td&gt;&lt;div class="sampleMessage"&gt;';
                echo '  No envelopes created, yet. Use the tabs to create an Envelope.';
                echo '&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;';

        }
    }

    //========================================================================
    // Main
    //========================================================================
    loginCheck();

    if ($_SERVER["REQUEST_METHOD"] == "POST") {

    }
    else if ($_SERVER["REQUEST_METHOD"] == "GET") {

    }

    ?&gt;

    &lt;!DOCTYPE html"&gt;
    &lt;html&gt;
        &lt;head&gt;
            &lt;link rel="stylesheet" href="css/default.css" /&gt;
            &lt;link rel="stylesheet" type="text/css" href="css/GetStatusAndDocs.css" /&gt;
            &lt;script type="text/javascript" src="js/Utils.js"&gt;&lt;/script&gt;
            &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
        &lt;/head&gt;
        &lt;body&gt;

            &lt;script type="text/javascript"&gt;
                    // Invert rows when clicking (not implemented, simple enough to view without deep-clicking)
                    function invert(ident) {
                        var state = document.getElementById(ident).style.display;
                        if (state == 'block') {
                            document.getElementById(ident).style.display = 'none';
                        } else {
                            document.getElementById(ident).style.display = 'block';
                        }
                    }
                &lt;/script&gt;

            &lt;div class="container"&gt;
                &lt;div class="authbox"&gt;
                    &lt;span&gt;&lt;?php echo $_SESSION["UserID"]; ?&gt;&lt;/span&gt; 
                    (&lt;a href="index.php?logout"&gt;logout&lt;/a&gt;)
                &lt;/div&gt;
                &lt;table class="tabs" cellspacing="0" cellpadding="0"&gt;
                    &lt;tr&gt;
                    &lt;td&gt;&lt;a href="senddocument.php"&gt;Send Document&lt;/a&gt;&lt;/td&gt;
                    &lt;td&gt;&lt;a href="sendatemplate.php"&gt;Send a Template&lt;/a&gt;&lt;/td&gt;
                    &lt;td&gt;&lt;a href="embeddocusign.php"&gt;Embed Docusign&lt;/a&gt;&lt;/td&gt;
                    &lt;td class="current"&gt;Get Status and Docs&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/table&gt;
                    &lt;div id="statusDiv"&gt;
                    &lt;?php createStatusTable(); ?&gt;
                &lt;/div&gt;
             &lt;?php include 'include/footer.html'; ?&gt;
            &lt;/div&gt;
        &lt;/body&gt;
    &lt;/html&gt;
</code></pre>
