Online PHP and Javascript Decoder decode hidden script to uncover its real functionality



 namespace pocketmine\math; use pocketmine\utils\Random; use function abs; use function ceil; use function floor; use function round; use function sqrt; class Vector2 { public $x; public $y; public function __construct(float $x = 0, float $y = 0) { $this->x = $x; $this->y = $y; } public function getX() : float { return $this->x; } public function getY() : float { return $this->y; } public function getFloorX() : int { return (int) floor($this->x); } public function getFloorY() : int { return (int) floor($this->y); } public function add($x, float $y = 0) { goto X0RyU; X0RyU: if ($x instanceof Vector2) { goto fURMS; } goto JQE84; QeWCA: return $this->add($x->x, $x->y); goto wlKxA; JQE84: return new Vector2($this->x + $x, $this->y + $y); goto wVaZS; wVaZS: goto hHr9D; goto ziJRi; ziJRi: fURMS: goto QeWCA; wlKxA: hHr9D: goto Q5Mk6; Q5Mk6: } public function subtract($x, float $y = 0) { goto avtlX; wMzjK: goto s0pdo; goto Mkm9Z; OzoiX: return $this->add(-$x->x, -$x->y); goto z2XR1; Nm2J1: return $this->add(-$x, -$y); goto wMzjK; z2XR1: s0pdo: goto T3wgc; Mkm9Z: rBwDY: goto OzoiX; avtlX: if ($x instanceof Vector2) { goto rBwDY; } goto Nm2J1; T3wgc: } public function ceil() { return new Vector2((int) ceil($this->x), (int) ceil($this->y)); } public function floor() { return new Vector2((int) floor($this->x), (int) floor($this->y)); } public function round() { return new Vector2(round($this->x), round($this->y)); } public function abs() { return new Vector2(abs($this->x), abs($this->y)); } public function multiply(float $number) { return new Vector2($this->x * $number, $this->y * $number); } public function divide(float $number) { return new Vector2($this->x / $number, $this->y / $number); } public function distance($x, float $y = 0) : float { goto iJGIL; f_nK0: BbgtQ: goto celpk; t4WM1: goto Kc9Ji; goto f_nK0; celpk: return sqrt($this->distanceSquared($x->x, $x->y)); goto hZuYO; iJGIL: if ($x instanceof Vector2) { goto BbgtQ; } goto bvfa2; bvfa2: return sqrt($this->distanceSquared($x, $y)); goto t4WM1; hZuYO: Kc9Ji: goto HsrXS; HsrXS: } public function distanceSquared($x, float $y = 0) : float { goto Tp_lo; emgD2: return ($this->x - $x) ** 2 + ($this->y - $y) ** 2; goto LPq7E; LPq7E: goto tAda1; goto OM7BP; Dnz0G: tAda1: goto cD9D3; OM7BP: ch_ZN: goto gnPB0; Tp_lo: if ($x instanceof Vector2) { goto ch_ZN; } goto emgD2; gnPB0: return $this->distanceSquared($x->x, $x->y); goto Dnz0G; cD9D3: } public function length() : float { return sqrt($this->lengthSquared()); } public function lengthSquared() : float { return $this->x * $this->x + $this->y * $this->y; } public function normalize() { goto U8OlN; U8OlN: $len = $this->lengthSquared(); goto Tgq_G; eIyda: return new Vector2(0, 0); goto TcHi7; Y3YxG: T30JZ: goto eIyda; QvhQr: return $this->divide(sqrt($len)); goto Y3YxG; Tgq_G: if (!($len != 0)) { goto T30JZ; } goto QvhQr; TcHi7: } public function dot(Vector2 $v) : float { return $this->x * $v->x + $this->y * $v->y; } public function __toString() { return "Vector2(x=" . $this->x . ",y=" . $this->y . ")"; } public static function createRandomDirection(Random $random) { return VectorMath::getDirection2D($random->nextFloat() * 2 * pi()); } }



© 2023 Quttera Ltd. All rights reserved.