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 PhabricatorPHID extends Phobject { public static function generateNe..

Decoded Output download

<?php

final class PhabricatorPHID extends Phobject {

  public static function generateNewPHID($type, $subtype = null) {
    if (!$type) {
      throw new Exception(pht('Can not generate PHID with no type.'));
    }

    if ($subtype === null) {
      $uniq_len = 20;
      $type_str = "{$type}";
    } else {
      $uniq_len = 15;
      $type_str = "{$type}-{$subtype}";
    }

    $uniq = Filesystem::readRandomCharacters($uniq_len);
    return "PHID-{$type_str}-{$uniq}";
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorPHID extends Phobject {

  public static function generateNewPHID($type, $subtype = null) {
    if (!$type) {
      throw new Exception(pht('Can not generate PHID with no type.'));
    }

    if ($subtype === null) {
      $uniq_len = 20;
      $type_str = "{$type}";
    } else {
      $uniq_len = 15;
      $type_str = "{$type}-{$subtype}";
    }

    $uniq = Filesystem::readRandomCharacters($uniq_len);
    return "PHID-{$type_str}-{$uniq}";
  }

}

Function Calls

None

Variables

None

Stats

MD5 a411207c584f2eadad6b5fc4b2f1689e
Eval Count 0
Decode Time 97 ms