round() doesn't work

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

round() doesn't work

Post by klevis miho »

Why doesn't this line of code works:

echo round(8.5, 0, PHP_ROUND_HALF_UP);

It displays me this error:
Wrong parameter count for round()

It's so strange because I copy and pasted it from the php manual http://php.net/manual/en/function.round.php
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: round() doesn't work

Post by Darhazer »

The third parameter is introduced in PHP 5.3.0
In PHP 5.2, there are only 2 parameters available
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: round() doesn't work

Post by klevis miho »

Thnx man :)
Post Reply