PHP code example of phpcompatibility / php-compatibility

1. Go to this page and download the library: Download phpcompatibility/php-compatibility library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phpcompatibility / php-compatibility example snippets

bash
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer global 
xml
    <!-- Whitelist the mysql_to_rfc3339() and mysql_another_function() functions. -->
    <rule ref="PHPCompatibility.Extensions.RemovedExtensions">
        <properties>
            <property name="functionWhitelist" type="array">
                <element value="mysql_to_rfc3339"/>
                <element value="mysql_another_function"/>
            </property>
        </properties>
    </rule>
xml
    <rule ref="PHPCompatibility.Interfaces.RemovedSerializable">
        <properties>
            <property name="serializableInterfaces" type="array">
                <element value="MyCustomSerializableInterface"/>
                <element value="AnotherSerializableInterface"/>
            </property>
        </properties>
    </rule>