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 final class PhabricatorRepositoryCommitTestCase extends PhabricatorTestCase { ..

Decoded Output download

<?php

final class PhabricatorRepositoryCommitTestCase
  extends PhabricatorTestCase {

  public function testSummarizeCommits() {
    // Cyrillic "zhe".
    $zhe = "";

    // Symbol "Snowman".
    $snowman = "";

    // Emoji "boar".
    $boar = "";

    // Proper unicode truncation is tested elsewhere, this is just making
    // sure column length handling is sane.

    $map = array(
      '' => 0,
      'a' => 1,
      str_repeat('a', 81) => 82,
      str_repeat('a', 255) => 82,
      str_repeat('aa ', 30) => 80,
      str_repeat($zhe, 300) => 161,
      str_repeat($snowman, 300) => 240,
      str_repeat($boar, 300) => 255,
    );

    foreach ($map as $input => $expect) {
      $actual = PhabricatorRepositoryCommitData::summarizeCommitMessage(
        $input);
      $this->assertEqual($expect, strlen($actual));
    }

  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorRepositoryCommitTestCase
  extends PhabricatorTestCase {

  public function testSummarizeCommits() {
    // Cyrillic "zhe".
    $zhe = "\xD0\xB6";

    // Symbol "Snowman".
    $snowman = "\xE2\x98\x83";

    // Emoji "boar".
    $boar = "\xF0\x9F\x90\x97";

    // Proper unicode truncation is tested elsewhere, this is just making
    // sure column length handling is sane.

    $map = array(
      '' => 0,
      'a' => 1,
      str_repeat('a', 81) => 82,
      str_repeat('a', 255) => 82,
      str_repeat('aa ', 30) => 80,
      str_repeat($zhe, 300) => 161,
      str_repeat($snowman, 300) => 240,
      str_repeat($boar, 300) => 255,
    );

    foreach ($map as $input => $expect) {
      $actual = PhabricatorRepositoryCommitData::summarizeCommitMessage(
        $input);
      $this->assertEqual($expect, strlen($actual));
    }

  }

}

Function Calls

None

Variables

None

Stats

MD5 e91d83c9b5c8210da728bc21238d8f88
Eval Count 0
Decode Time 106 ms