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 namespace Whoops\Exception; use InvalidArgumentException; use Serializable; class F..

Decoded Output download

<?php
 namespace Whoops\Exception; use InvalidArgumentException; use Serializable; class Frame implements Serializable { protected $frame; protected $fileContentsCache; protected $comments = array(); protected $application; public function __construct(array $frame) { $this->frame = $frame; } public function getFile($shortened = false) { if (empty($this->frame["file"])) { return null; } $file = $this->frame["file"]; if (preg_match("/^(.*)\((\d+)\) : (?:eval\(\)'d|assert) code$/", $file, $matches)) { $file = $this->frame["file"] = $matches[1]; $this->frame["line"] = (int) $matches[2]; } if ($shortened && is_string($file)) { $dirname = dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))); if ($dirname !== "/") { $file = str_replace($dirname, "&hellip;", $file); } $file = str_replace("/", "/&shy;", $file); } return $file; } public function getLine() { return isset($this->frame["line"]) ? $this->frame["line"] : null; } public function getClass() { return isset($this->frame["class"]) ? $this->frame["class"] : null; } public function getFunction() { return isset($this->frame["function"]) ? $this->frame["function"] : null; } public function getArgs() { return isset($this->frame["args"]) ? (array) $this->frame["args"] : array(); } public function getFileContents() { if ($this->fileContentsCache === null && ($filePath = $this->getFile())) { if ($filePath === "Unknown" || $filePath === "[internal]") { return null; } try { $this->fileContentsCache = file_get_contents($filePath); } catch (ErrorException $exception) { } } return $this->fileContentsCache; } public function addComment($comment, $context = "global") { $this->comments[] = array("comment" => $comment, "context" => $context); } public function getComments($filter = null) { $comments = $this->comments; if ($filter !== null) { $comments = array_filter($comments, function ($c) use($filter) { return $c["context"] == $filter; }); } return $comments; } public function getRawFrame() { return $this->frame; } public function getFileLines($start = 0, $length = null) { if (null !== ($contents = $this->getFileContents())) { $lines = explode("
", $contents); if ($length !== null) { $start = (int) $start; $length = (int) $length; if ($start < 0) { $start = 0; } if ($length <= 0) { throw new InvalidArgumentException("$length({$length}) cannot be lower or equal to 0"); } $lines = array_slice($lines, $start, $length, true); } return $lines; } } public function serialize() { $frame = $this->frame; if (!empty($this->comments)) { $frame["_comments"] = $this->comments; } return serialize($frame); } public function __serialize() { $frame = $this->frame; if (!empty($this->comments)) { $frame["_comments"] = $this->comments; } return $frame; } public function unserialize($serializedFrame) { $frame = unserialize($serializedFrame); if (!empty($frame["_comments"])) { $this->comments = $frame["_comments"]; unset($frame["_comments"]); } $this->frame = $frame; } public function __unserialize($frame) { if (!empty($frame["_comments"])) { $this->comments = $frame["_comments"]; unset($frame["_comments"]); } $this->frame = $frame; } public function equals(Frame $frame) { if (!$this->getFile() || $this->getFile() === "Unknown" || !$this->getLine()) { return false; } return $frame->getFile() === $this->getFile() && $frame->getLine() === $this->getLine(); } public function isApplication() { return $this->application; } public function setApplication($application) { $this->application = $application; } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace Whoops\Exception; use InvalidArgumentException; use Serializable; class Frame implements Serializable { protected $frame; protected $fileContentsCache; protected $comments = array(); protected $application; public function __construct(array $frame) { $this->frame = $frame; } public function getFile($shortened = false) { if (empty($this->frame["\146\151\154\x65"])) { return null; } $file = $this->frame["\x66\x69\154\145"]; if (preg_match("\57\x5e\50\x2e\52\51\x5c\x28\x28\134\144\x2b\x29\x5c\51\x20\x3a\x20\50\x3f\72\x65\166\x61\154\x5c\50\x5c\x29\x27\144\174\x61\x73\x73\145\x72\x74\51\x20\x63\x6f\x64\145\44\x2f", $file, $matches)) { $file = $this->frame["\x66\x69\154\x65"] = $matches[1]; $this->frame["\x6c\151\x6e\x65"] = (int) $matches[2]; } if ($shortened && is_string($file)) { $dirname = dirname(dirname(dirname(dirname(dirname(dirname(__DIR__)))))); if ($dirname !== "\x2f") { $file = str_replace($dirname, "\x26\x68\x65\x6c\x6c\151\x70\x3b", $file); } $file = str_replace("\57", "\57\46\163\150\x79\73", $file); } return $file; } public function getLine() { return isset($this->frame["\x6c\151\x6e\145"]) ? $this->frame["\x6c\151\x6e\145"] : null; } public function getClass() { return isset($this->frame["\x63\154\x61\x73\x73"]) ? $this->frame["\143\154\x61\163\163"] : null; } public function getFunction() { return isset($this->frame["\146\165\x6e\x63\x74\151\157\156"]) ? $this->frame["\146\x75\x6e\x63\164\x69\x6f\x6e"] : null; } public function getArgs() { return isset($this->frame["\x61\162\x67\163"]) ? (array) $this->frame["\x61\162\147\163"] : array(); } public function getFileContents() { if ($this->fileContentsCache === null && ($filePath = $this->getFile())) { if ($filePath === "\x55\156\x6b\156\x6f\x77\156" || $filePath === "\x5b\x69\x6e\164\145\162\x6e\141\x6c\x5d") { return null; } try { $this->fileContentsCache = file_get_contents($filePath); } catch (ErrorException $exception) { } } return $this->fileContentsCache; } public function addComment($comment, $context = "\x67\154\157\142\x61\154") { $this->comments[] = array("\x63\x6f\x6d\x6d\145\x6e\x74" => $comment, "\143\x6f\156\164\x65\x78\x74" => $context); } public function getComments($filter = null) { $comments = $this->comments; if ($filter !== null) { $comments = array_filter($comments, function ($c) use($filter) { return $c["\x63\x6f\x6e\x74\145\x78\x74"] == $filter; }); } return $comments; } public function getRawFrame() { return $this->frame; } public function getFileLines($start = 0, $length = null) { if (null !== ($contents = $this->getFileContents())) { $lines = explode("\12", $contents); if ($length !== null) { $start = (int) $start; $length = (int) $length; if ($start < 0) { $start = 0; } if ($length <= 0) { throw new InvalidArgumentException("\x24\x6c\145\156\147\164\150\x28{$length}\51\40\143\x61\156\x6e\x6f\x74\x20\x62\x65\x20\154\157\x77\145\162\x20\157\x72\40\145\x71\165\141\154\x20\x74\x6f\x20\60"); } $lines = array_slice($lines, $start, $length, true); } return $lines; } } public function serialize() { $frame = $this->frame; if (!empty($this->comments)) { $frame["\x5f\x63\x6f\x6d\155\x65\156\164\x73"] = $this->comments; } return serialize($frame); } public function __serialize() { $frame = $this->frame; if (!empty($this->comments)) { $frame["\x5f\143\x6f\x6d\x6d\x65\156\x74\163"] = $this->comments; } return $frame; } public function unserialize($serializedFrame) { $frame = unserialize($serializedFrame); if (!empty($frame["\137\143\157\155\155\x65\156\164\163"])) { $this->comments = $frame["\137\143\157\x6d\x6d\x65\156\x74\x73"]; unset($frame["\137\x63\x6f\x6d\155\145\156\164\163"]); } $this->frame = $frame; } public function __unserialize($frame) { if (!empty($frame["\x5f\x63\x6f\x6d\x6d\145\156\164\163"])) { $this->comments = $frame["\x5f\x63\x6f\155\x6d\145\x6e\x74\163"]; unset($frame["\137\x63\x6f\155\155\x65\x6e\x74\x73"]); } $this->frame = $frame; } public function equals(Frame $frame) { if (!$this->getFile() || $this->getFile() === "\x55\x6e\153\x6e\x6f\167\x6e" || !$this->getLine()) { return false; } return $frame->getFile() === $this->getFile() && $frame->getLine() === $this->getLine(); } public function isApplication() { return $this->application; } public function setApplication($application) { $this->application = $application; } }

Function Calls

None

Variables

None

Stats

MD5 413865c3d6b10b4606b9fb3045fcbe05
Eval Count 0
Decode Time 129 ms