Next: , Previous: Differences Between Roadsend And Zend PHP, Up: Language Reference


4.2 Writing Portable PHP Code

One goal of Roadsend PHP is to maintain compatibility with code written for Zend PHP. However there may be times when you will need to have your code run differently in the two different environments.

Roadsend PHP defines a constant (ROADSEND_PHP) that you can use in your code to determine which PHP environment is executing in.

     
     <?php
     
     if (defined('ROADSEND_PHP')) {
        echo "I am running under Roadsend PHP!\n";
     }
     else {
        echo "I am running under Zend PHP!\n";
     }
     
     ?>