1--TEST--
2Test variations in usage of sqrt()
3--INI--
4precision = 14
5--FILE--
6<?php
7/*
8 * Function is implemented in ext/standard/math.c
9*/
10
11
12//Test sqrt with a different input values
13echo "*** Testing sqrt() : usage variations ***\n";
14
15$values = array(23,
16        -23,
17        2.345e1,
18        -2.345e1,
19        0x17,
20        027,
21        "23",
22        "23.45",
23        "2.345e1",
24        "1000",
25        true,
26        false);
27
28for ($i = 0; $i < count($values); $i++) {
29    $res = sqrt($values[$i]);
30    var_dump($res);
31}
32
33?>
34--EXPECT--
35*** Testing sqrt() : usage variations ***
36float(4.795831523312719)
37float(NAN)
38float(4.8425200051213)
39float(NAN)
40float(4.795831523312719)
41float(4.795831523312719)
42float(4.795831523312719)
43float(4.8425200051213)
44float(4.8425200051213)
45float(31.622776601683793)
46float(1)
47float(0)
48