declared variable correct format – Magento Stack Exchange

I am not sure I do it right or not to declared variable in a template phtml file
I have 4 variables

$canadaPostCarrierCode = 'canadapost'; // Canada Post carrier code 
        $canadaPostURL = 'https://www.canadapost-postescanada.ca/track-reperage/en#/';  // Canada Post tracking URL
        $purolatorCarrierCode = 'purolator';  // Purolator carrier code
        $purolatorURL = 'https://www.purolator.com/en/shipping/tracker?pins='; // Purolator tracking URL

I am not sure the format is correct in use at Magento or not, can anyone of you to clarify, I am using the correct format?

 <table class="shipment-track" style="width: 100%;">
        <thead>
        <tr style="text-align: left; background-color: #EAEAEA; font-size:13px; line-height:1em">
            <th style="padding:5px 9px 6px 9px"><?= /* @escapeNotVerified */  __('Shipped By') ?></th>
            <th style="padding:5px 9px 6px 9px; width: 20%"><?= /* @escapeNotVerified */  __('Tracking Number') ?></th>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($_order->getTracksCollection() as $_item) : ?>
            <tr>
                <td style="padding:5px 9px 6px 9px"><?= $escaper->escapeHtml($_item->getTitle()) ?></td>
        <?php
        $canadaPostCarrierCode = 'canadapost'; // Canada Post carrier code 
        $canadaPostURL = 'https://www.canadapost-postescanada.ca/track-reperage/en#/';  // Canada Post tracking URL
        $purolatorCarrierCode = 'purolator';  // Purolator carrier code
        $purolatorURL = 'https://www.purolator.com/en/shipping/tracker?pins='; // Purolator tracking URL
        $trackurl = '';
        
        if($_item->getCarrierCode() === $canadaPostCarrierCode){
            $trackurl = $canadaPostURL . $_item->getNumber() ?>
                <td style="padding:5px 9px 6px 9px"><a href="<?= $trackurl ?>">
                        <?= $this->escapeHtml($_item->getNumber()) ?></a></td>
        <?php } elseif ($_item->getCarrierCode() === $purolatorCarrierCode ) {
            $trackurl = $purolatorURL  . $_item->getNumber() ?>
                <td style="padding:5px 9px 6px 9px"><a href="<?= $trackurl ?>">
                        <?= $this->escapeHtml($_item->getNumber()) ?></a></td>
        <?php } else { ?>
                <td style="padding:5px 9px 6px 9px"><?= $escaper->escapeHtml($_item->getNumber()); ?></td>
        <?php } ?>
            </tr>
        <?php endforeach ?>
        </tbody>
    </table>