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        null,
26        true,
27        false);
28
29for ($i = 0; $i < count($values); $i++) {
30    $res = sqrt($values[$i]);
31    var_dump($res);
32}
33
34?>
35--EXPECT--
36*** Testing sqrt() : usage variations ***
37float(4.795831523312719)
38float(NAN)
39float(4.8425200051213)
40float(NAN)
41float(4.795831523312719)
42float(4.795831523312719)
43float(4.795831523312719)
44float(4.8425200051213)
45float(4.8425200051213)
46float(31.622776601683793)
47float(0)
48float(1)
49float(0)
50