1--TEST--
2Test variations in usage of sin()
3--INI--
4precision = 10
5--FILE--
6<?php
7/*
8 * proto float sin(float number)
9 * Function is implemented in ext/standard/math.c
10*/
11
12
13//Test sin with a different input values
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		"nonsense",
25		"1000",
26		"1000ABC",
27		null,
28		true,
29		false);
30
31for ($i = 0; $i < count($values); $i++) {
32	$res = sin($values[$i]);
33	var_dump($res);
34}
35
36?>
37--EXPECTF--
38float(-0.8462204042)
39float(0.8462204042)
40float(-0.9937407102)
41float(0.9937407102)
42float(-0.8462204042)
43float(-0.8462204042)
44float(-0.8462204042)
45float(-0.9937407102)
46float(-0.9937407102)
47
48Warning: sin() expects parameter 1 to be double, string given in %s on line %d
49NULL
50float(0.8268795405)
51
52Notice: A non well formed numeric value encountered in %s on line %d
53float(0.8268795405)
54float(0)
55float(0.8414709848)
56float(0)
57