final protected static function valueIsDifferent($original, $current): bool
    {
        // check if some value is null
        $originalIsNull = (null === $original);
        $currentIsNull = (null === $current);
        // both are null, there are no difference
        if ($originalIsNull && $currentIsNull) {
            return false;
        }
        // one is null, the other isn't, there is a difference
        if ($originalIsNull || $currentIsNull) {
            return true;
        }
        // do not continue using the object, convert to string
        if (is_object($current)) {
            $current = strval($current);
        }
        // strict comparison if types are strings
        if (is_string($original) && is_string($current)) {
            return ($original !== $current);
        }
        // simple comparison
        return ($original != $current);
    }
final protected static function valueIsDifferent($original, $current): bool
    {
        // check if some value is null
        $originalIsNull = (null === $original);
        $currentIsNull = (null === $current);
        // both are null, there are no difference
        if ($originalIsNull && $currentIsNull) {
            return false;
        }
        // one is null, the other isn't, there is a difference
        if ($originalIsNull || $currentIsNull) {
            return true;
        }
        // do not continue using the object, convert to string
        if (is_object($current)) {
            $current = strval($current);
        }
        // strict comparison if types are strings
        if (is_string($original) && is_string($current)) {
            return ($original !== $current);
        }
        // simple comparison
        return ($original != $current);
    }
final protected static function valueIsDifferent ( $ original , $ current ) : bool { // check if some value is null $ originalIsNull = ( null === $ original ) ; $ currentIsNull = ( null === $ current ) ; // both are null, there are no difference if ( $ originalIsNull && $ currentIsNull ) { return false ; } // one is null, the other isn't, there is a difference if ( $ originalIsNull || $ currentIsNull ) { return true ; } // do not continue using the object, convert to string if ( is_object ( $ current ) ) { $ current = strval ( $ current ) ; } // strict comparison if types are strings if ( is_string ( $ original ) && is_string ( $ current ) ) { return ( $ original !== $ current ) ; } // simple comparison return ( $ original != $ current ) ; }
Compare to values in order to see if they need to be updated
@param mixed $original
@param mixed $current
@return bool
Compare to values in order to see if they need to be updated