View Single Post
  #45  
Old 04-29-2009, 02:29 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Raelyn View Post
Well that's lame. :/

Do classes operate like global functions? Like, if I put all my functions into classes, I can call them up in any scripts on the server?
You'd have to join that class to use it's content.

Lets say this is a class called fibonacci:

PHP Code:
function fib(n) {
  return (((
1+5^0.5)/2)^- ((1-5^0.5)/2)^n)/(5^0.5)


To use that function, I would have to do:

PHP Code:
function onCreated() {
  
join("fibonacci");

  echo(
fib(7)); // 13

__________________
Reply With Quote