1--TEST--
2Test decbin() - basic function test
3--FILE--
4<?php
5$values = array(10,
6                3950.5,
7                3.9505e3,
8                03,
9                0x5F,
10                "10",
11                "3950.5",
12                "3.9505e3",
13                "039",
14                "0x5F",
15                true,
16                false,
17                );
18
19foreach ($values as $value) {
20    try {
21       var_dump(decbin($value));
22    } catch (TypeError $exception) {
23        echo $exception->getMessage() . "\n";
24    }
25}
26
27?>
28--EXPECTF--
29string(4) "1010"
30
31Deprecated: Implicit conversion from float 3950.5 to int loses precision in %s on line %d
32string(12) "111101101110"
33
34Deprecated: Implicit conversion from float 3950.5 to int loses precision in %s on line %d
35string(12) "111101101110"
36string(2) "11"
37string(7) "1011111"
38string(4) "1010"
39
40Deprecated: Implicit conversion from float-string "3950.5" to int loses precision in %s on line %d
41string(12) "111101101110"
42
43Deprecated: Implicit conversion from float-string "3.9505e3" to int loses precision in %s on line %d
44string(12) "111101101110"
45string(6) "100111"
46decbin(): Argument #1 ($num) must be of type int, string given
47string(1) "1"
48string(1) "0"
49