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 /** * This file is part of the reliforp/reli-prof package. * * (c) sji <sji@sj-i..

Decoded Output download

<?php

/**
 * This file is part of the reliforp/reli-prof package.
 *
 * (c) sji <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Reli\Lib\String;

use Reli\BaseTestCase;

class LineFetcherTest extends BaseTestCase
{
    public function testCreateGenerator()
    {
        $string = <<<STR
        hoge
        hige
        huge
        STR;
        $result = [];
        $line_fetcher = new LineFetcher();
        foreach ($line_fetcher->createIterable($string) as $line) {
            $result[] = $line;
        }
        $this->assertSame(
            [
                'hoge',
                'hige',
                'huge',
            ],
            $result
        );
    }

    public function testCreateGeneratorLineBreakOnly()
    {
        $string = "
";
        $result = [];
        $line_fetcher = new LineFetcher();
        foreach ($line_fetcher->createIterable($string) as $line) {
            $result[] = $line;
        }
        $this->assertSame(
            [
                '',
            ],
            $result
        );
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

/**
 * This file is part of the reliforp/reli-prof package.
 *
 * (c) sji <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Reli\Lib\String;

use Reli\BaseTestCase;

class LineFetcherTest extends BaseTestCase
{
    public function testCreateGenerator()
    {
        $string = <<<STR
        hoge
        hige
        huge
        STR;
        $result = [];
        $line_fetcher = new LineFetcher();
        foreach ($line_fetcher->createIterable($string) as $line) {
            $result[] = $line;
        }
        $this->assertSame(
            [
                'hoge',
                'hige',
                'huge',
            ],
            $result
        );
    }

    public function testCreateGeneratorLineBreakOnly()
    {
        $string = "\n";
        $result = [];
        $line_fetcher = new LineFetcher();
        foreach ($line_fetcher->createIterable($string) as $line) {
            $result[] = $line;
        }
        $this->assertSame(
            [
                '',
            ],
            $result
        );
    }
}

Function Calls

None

Variables

None

Stats

MD5 ccc54682d6c843cbd7152f9bb2fd1488
Eval Count 0
Decode Time 92 ms