'azjezz/psl', 'type' => 'library', 'description' => 'PHP Standard Library.', 'keywords' => ['php', 'std', 'stdlib', 'utility', 'psl'], 'license' => 'MIT' ], true); $json = Str\replace(<<expectException(Json\Exception\EncodeException::class); $this->expectExceptionMessage('Malformed UTF-8 characters, possibly incorrectly encoded.'); Json\encode(["bad utf\xFF"]); } public function testEncodeThrowsWithNAN(): void { $this->expectException(Json\Exception\EncodeException::class); $this->expectExceptionMessage('Inf and NaN cannot be JSON encoded.'); Json\encode(Math\NAN); } public function testEncodeThrowsWithInf(): void { $this->expectException(Json\Exception\EncodeException::class); $this->expectExceptionMessage('Inf and NaN cannot be JSON encoded.'); Json\encode(Math\INFINITY); } public function testEncodePreserveZeroFraction(): void { static::assertSame('1.0', Json\encode(1.0)); } }