Where are built in functions stored?

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
mkoplow
Forum Newbie
Posts: 4
Joined: Sun Sep 03, 2006 8:11 am

Where are built in functions stored?

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
mkoplow
Forum Newbie
Posts: 4
Joined: Sun Sep 03, 2006 8:11 am

Post by mkoplow »

It is being stored on a linux slug. phpinfo() is displayed here:
http://flash.me.berkeley.edu:8080/phpinfo.php
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
mkoplow
Forum Newbie
Posts: 4
Joined: Sun Sep 03, 2006 8:11 am

Post by mkoplow »

So is there any reason why when I do

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

The result says INF

??
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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
mkoplow
Forum Newbie
Posts: 4
Joined: Sun Sep 03, 2006 8:11 am

Post 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!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

What errors, specifically, are you getting?
Post Reply