Page 1 of 1

Where are built in functions stored?

Posted: Sun Sep 03, 2006 8:16 am
by mkoplow
I am porting code I used for one project into another and am receiving errors when I try to use the built in function "round". I can create my own round function and the code will work, but I'd like to know why the built in round function isn't working for this version of php. The server is using php 4. How do I find where the built in functions are stored to see if perhaps the round function is missing? This is extremely frustrating for such a small issue, please help!

Thanks!
Mike

Posted: Sun Sep 03, 2006 8:46 am
by volka
What kind of server is it? (OS? your own machine? php as binary packet or from source? ...)

round() is part of the Math module
http://de2.php.net/manual/en/ref.math.php wrote:Installation
There is no installation needed to use these functions; they are part of the PHP core.

Posted: Sun Sep 03, 2006 8:58 am
by mkoplow
It is being stored on a linux slug. phpinfo() is displayed here:
http://flash.me.berkeley.edu:8080/phpinfo.php

Posted: Sun Sep 03, 2006 9:09 am
by volka
mkoplow wrote:The server is using php 4.
the phpinfo page is for php 5.1.6. And I can't see anything unusal in the config options.

Posted: Sun Sep 03, 2006 9:13 am
by mkoplow
So is there any reason why when I do

$y = 1000.1;
echo round($y);

The result says INF

??

Posted: Sun Sep 03, 2006 2:37 pm
by volka
I don't no. But the error message for an undefined function is different.

Code: Select all

<?php
error_reporting(E_ALL); ini_set('display_errors', true);
notAFunction(); 
?>
Fatal error: Unknown function: notafunction() in [...] on line 3

Posted: Sun Sep 03, 2006 2:56 pm
by mkoplow
So back to my original question. Where/how can I get a copy of the function round() ? I need one that also allows for variable precision.

Thanks!

Posted: Sun Sep 03, 2006 2:58 pm
by feyd
What errors, specifically, are you getting?