Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php declare(strict_types=1); namespace PhpOffice\PhpSpreadsheetTests\Writer\Xls; use ..

Decoded Output download

<?php

declare(strict_types=1);

namespace PhpOffice\PhpSpreadsheetTests\Writer\Xls;

use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Exception as WriterException;
use PhpOffice\PhpSpreadsheet\Writer\Xls\Parser;
use PHPUnit\Framework\TestCase;

class ParserTest extends TestCase
{
    /** @var ?Spreadsheet */
    private ?Spreadsheet $spreadsheet = null;

    protected function tearDown(): void
    {
        if ($this->spreadsheet !== null) {
            $this->spreadsheet->disconnectWorksheets();
            $this->spreadsheet = null;
        }
    }

    public function testNonArray(): void
    {
        $this->expectException(WriterException::class);
        $this->expectExceptionMessage('Unexpected non-array');
        $this->spreadsheet = new Spreadsheet();
        $parser = new Parser($this->spreadsheet);
        $parser->toReversePolish();
    }

    public function testMissingIndex(): void
    {
        $this->expectException(WriterException::class);
        $this->expectExceptionMessage('Unexpected non-array');
        $this->spreadsheet = new Spreadsheet();
        $parser = new Parser($this->spreadsheet);
        $parser->toReversePolish(['left' => 0]);
    }

    public function testParseError(): void
    {
        $this->expectException(WriterException::class);
        $this->expectExceptionMessage('Unknown token +');
        $this->spreadsheet = new Spreadsheet();
        $parser = new Parser($this->spreadsheet);
        $parser->toReversePolish(['left' => 1, 'right' => 2, 'value' => '+']);
    }

    public function testGoodParse(): void
    {
        $this->spreadsheet = new Spreadsheet();
        $parser = new Parser($this->spreadsheet);
        self::assertSame('1e01001e02001e0300', bin2hex($parser->toReversePolish(['left' => 1, 'right' => 2, 'value' => 3])));
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace PhpOffice\PhpSpreadsheetTests\Writer\Xls;

use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Exception as WriterException;
use PhpOffice\PhpSpreadsheet\Writer\Xls\Parser;
use PHPUnit\Framework\TestCase;

class ParserTest extends TestCase
{
    /** @var ?Spreadsheet */
    private ?Spreadsheet $spreadsheet = null;

    protected function tearDown(): void
    {
        if ($this->spreadsheet !== null) {
            $this->spreadsheet->disconnectWorksheets();
            $this->spreadsheet = null;
        }
    }

    public function testNonArray(): void
    {
        $this->expectException(WriterException::class);
        $this->expectExceptionMessage('Unexpected non-array');
        $this->spreadsheet = new Spreadsheet();
        $parser = new Parser($this->spreadsheet);
        $parser->toReversePolish();
    }

    public function testMissingIndex(): void
    {
        $this->expectException(WriterException::class);
        $this->expectExceptionMessage('Unexpected non-array');
        $this->spreadsheet = new Spreadsheet();
        $parser = new Parser($this->spreadsheet);
        $parser->toReversePolish(['left' => 0]);
    }

    public function testParseError(): void
    {
        $this->expectException(WriterException::class);
        $this->expectExceptionMessage('Unknown token +');
        $this->spreadsheet = new Spreadsheet();
        $parser = new Parser($this->spreadsheet);
        $parser->toReversePolish(['left' => 1, 'right' => 2, 'value' => '+']);
    }

    public function testGoodParse(): void
    {
        $this->spreadsheet = new Spreadsheet();
        $parser = new Parser($this->spreadsheet);
        self::assertSame('1e01001e02001e0300', bin2hex($parser->toReversePolish(['left' => 1, 'right' => 2, 'value' => 3])));
    }
}

Function Calls

None

Variables

None

Stats

MD5 491f2e3a5478c1d471377528b5072974
Eval Count 0
Decode Time 71 ms