!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/smabpro.picotech.app/public_html/vendor/sebastian/diff/src/   drwxr-xr-x
Free 28.57 GB of 117.98 GB (24.22%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     MemoryEfficientLongestCommonSubsequenceCalculator.php (2.61 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php declare(strict_types=1);
/*
 * This file is part of sebastian/diff.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace SebastianBergmann\Diff;

use function 
array_fill;
use function 
array_merge;
use function 
array_reverse;
use function 
array_slice;
use function 
count;
use function 
in_array;
use function 
max;

final class 
MemoryEfficientLongestCommonSubsequenceCalculator implements LongestCommonSubsequenceCalculator
{
    
/**
     * @inheritDoc
     */
    
public function calculate(array $from, array $to): array
    {
        
$cFrom count($from);
        
$cTo   count($to);

        if (
$cFrom === 0) {
            return [];
        }

        if (
$cFrom === 1) {
            if (
in_array($from[0], $totrue)) {
                return [
$from[0]];
            }

            return [];
        }

        
$i         = (int) ($cFrom 2);
        
$fromStart array_slice($from0$i);
        
$fromEnd   array_slice($from$i);
        
$llB       $this->length($fromStart$to);
        
$llE       $this->length(array_reverse($fromEnd), array_reverse($to));
        
$jMax      0;
        
$max       0;

        for (
$j 0$j <= $cTo$j++) {
            
$m $llB[$j] + $llE[$cTo $j];

            if (
$m >= $max) {
                
$max  $m;
                
$jMax $j;
            }
        }

        
$toStart array_slice($to0$jMax);
        
$toEnd   array_slice($to$jMax);

        return 
array_merge(
            
$this->calculate($fromStart$toStart),
            
$this->calculate($fromEnd$toEnd),
        );
    }

    private function 
length(array $from, array $to): array
    {
        
$current array_fill(0count($to) + 10);
        
$cFrom   count($from);
        
$cTo     count($to);

        for (
$i 0$i $cFrom$i++) {
            
$prev $current;

            for (
$j 0$j $cTo$j++) {
                if (
$from[$i] === $to[$j]) {
                    
$current[$j 1] = $prev[$j] + 1;
                } else {
                    
/**
                     * @noinspection PhpConditionCanBeReplacedWithMinMaxCallInspection
                     *
                     * We do not use max() here to avoid the function call overhead
                     */
                    
if ($current[$j] > $prev[$j 1]) {
                        
$current[$j 1] = $current[$j];
                    } else {
                        
$current[$j 1] = $prev[$j 1];
                    }
                }
            }
        }

        return 
$current;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0039 ]--