<?php
/**
 * Forward/Backward compatibility layer
 *
 * @copyright 2016 night1ynx
 * @license   GPLv2 or later
 */

/**
 * E_USER_DEPRECATED was introduced since PHP 5.3
 */
if (! defined('E_USER_DEPRECATED')) {
    define('E_USER_DEPRECATED', E_USER_WARNING);
}

if (! function_exists('ereg')) {
    /**
     * @deprecated
     */
    function ereg($pattern, $string, &$regs = array()) {
        trigger_error('ereg() was removed in PHP 7.0', E_USER_DEPRECATED);
        return mb_ereg($pattern, $string, $regs);
    }
}

if (! function_exists('ereg_replace')) {
    /**
     * @deprecated
     */
    function ereg_replace($pattern, $replacement, $string) {
        trigger_error('ereg_replace() was removed in PHP 7.0', E_USER_DEPRECATED);
        return mb_ereg_replace($pattern, $replacement, $string);
    }
}

if (! function_exists('split')) {
    /**
     * @deprecated
     */
    function split($pattern, $string, $limit = -1) {
        trigger_error('split() was removed in PHP 7.0', E_USER_DEPRECATED);
        return mb_split($pattern, $string, $limit);
    }
}
