1.2.1020. Redeclared PHP Functions

Function that bear the same name as a PHP function, and that are declared.

This is useful when managing backward compatibility, like emulating an old function, or preparing for newer PHP versions, like emulating new upcoming function.

<?php

if (version_compare(PHP_VERSION, 7.0) > 0) {
    function split($separator, $string) {
        return explode($separator, $string);
    }
}

print_r( split(' ', '2 3'));

?>

1.2.1020.1. Suggestions

  • Check if it is still worth emulating that function

1.2.1020.2. Specs

Short name

Functions/RedeclaredPhpFunction

Rulesets

All, Analyze, Appinfo, CE, CI-checks

Exakat since

0.8.4

PHP Version

All

Severity

Minor

Time To Fix

Slow (1 hour)

Precision

Very high

Features

function

Available in

Entreprise Edition, Community Edition, Exakat Cloud