Menu Home

decoct

osbo.com | PHP | Functions | decoct

Decimal to octal

Syntax

decoct ( int $number ) : string

Parameters

number

Decimal value to convert

Negative Decimal Positive Decimal Octal
0 0
1 1
2 2
... ...
9223372036854775806 777777777777777777776
9223372036854775807 (largest signed integer) 777777777777777777777
-9223372036854775808 9223372036854775808 1000000000000000000000
... ... ...
-2 18446744073709551614 1777777777777777777776
-1 18446744073709551615 (largest unsigned integer) 1777777777777777777777

Return

Octal string representation of number

Examples

1

0

2

1

3

2

4

777777777777777777776

5

777777777777777777777

6

1000000000000000000000
1000000000000000000000

7

1777777777777777777776
0

8

1777777777777777777777
0

PHP