Files
kulakpos_web/vendor/thecodingmachine/safe/generated/8.1/json.php

24 lines
467 B
PHP
Raw Normal View History

2026-03-30 14:54:57 +07:00
<?php
namespace Safe;
use Safe\Exceptions\JsonException;
/**
2026-04-18 20:32:18 +07:00
* @param mixed $value
* @param int $flags
* @param positive-int $depth
* @return non-empty-string
2026-03-30 14:54:57 +07:00
* @throws JsonException
*
*/
function json_encode($value, int $flags = 0, int $depth = 512): string
{
error_clear_last();
$safeResult = \json_encode($value, $flags, $depth);
if ($safeResult === false) {
throw JsonException::createFromPhpError();
}
return $safeResult;
}