File: json.phpt

package info (click to toggle)
php-decimal 1.5.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 456 kB
  • sloc: ansic: 1,928; xml: 102; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 336 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
Decimal json_encode
--SKIPIF--
<?php
if (!extension_loaded("decimal")) echo 'skip';
if (!extension_loaded("json"))    echo 'skip';
?>
--FILE--
<?php
use Decimal\Decimal;

var_dump(json_encode(new Decimal("1.2345", 20)));
var_dump(json_encode(new Decimal("5.0000", 20)));
?>
--EXPECT--
string(8) ""1.2345""
string(8) ""5.0000""