473,320 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

[PHP4.3] Are not-used functions compiled by PHP?

Hi group,

[concerning PHP4.3]

I have an includefile that I (ahum) include in many scripts.
It contains only functions I need now and then.

Now I was wondering how things work behind the scenes.
Is the whole file loaded and compiled/interpreted every time a php-file is
used that includes this file?
That would be an unwanted extra load for my server.
If so, I should consider splitting up that file in some smaller files, but
that is of course extra overhead for me.

I have no idea how this works.
Can anybody enlighten me?

Thanks for your time!

Regards,
Erwin Moller
Jul 17 '05 #1
2 1506
When you include() a file that contains a series of functions then PHP will
parse the whole file, which means all the functions contained within that
file. PHP does not wait until you actually call a function to parse it. If
there are functions that are loaded but not used this may seem like an
unnecessary overhead, but if you put each function into a separate file you
should be aware of the following:
(a) If each function is in a separate file then you will have to remember to
include() it before you can use it.
(b) The time taken to open and load a file is greater than the time taken to
parse the contents of a file, so having a dozen functions in a single file
is quicker than loading a dozen functions from a dozen files.

What I actually do is to split my functions into groups and put all
functions within the same group into the same file, thus I have one file for
session functions, another for XML/XSL functions and so on.

HTH.

--
Tony Marston

http://www.tonymarston.net
"Erwin Moller"
<si******************************************@spam yourself.com> wrote in
message news:40***********************@news.xs4all.nl...
Hi group,

[concerning PHP4.3]

I have an includefile that I (ahum) include in many scripts.
It contains only functions I need now and then.

Now I was wondering how things work behind the scenes.
Is the whole file loaded and compiled/interpreted every time a php-file is
used that includes this file?
That would be an unwanted extra load for my server.
If so, I should consider splitting up that file in some smaller files, but
that is of course extra overhead for me.

I have no idea how this works.
Can anybody enlighten me?

Thanks for your time!

Regards,
Erwin Moller

Jul 17 '05 #2
That is very clear.

Thanks Tony.

Regards,
Erwin Moller
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Erik | last post by:
I understand, that PHP4 has a MySQL client built in. I was warned, that this client does not support the MySQL 4.1.1 system, which I installed on my RH9 box end that I need to install that version...
5
by: Tim Tyler | last post by:
I'm sure this is a FAQ - but I could not find a coherent statement of the answer: Some of my clients want PHP4. Other ones want PHP5. Can I run both PHP4 and PHP5 under the same instance of...
1
by: porneL | last post by:
I've had setup on WinXP: Apache1.3 with PHP4 module and PHP5 installedas CGI for one vhost. This worked fine, till I installed Zend Studio 4 beta. I'm trying to make Zend Server use my...
0
by: dk_sz | last post by:
Can anyone point me to a guide or something for conversion? I tryed http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/index.en.html but it doesn't work (not all parts anyway) - and as I...
2
by: dk_sz | last post by:
Can anyone point me to a guide or something for conversion? I tryed http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/index.en.html but it doesn't work (not all parts anyway) - and as I...
4
by: Kevin | last post by:
Hi all, I've got a PHP4 app that I developed which I'm trying to get to run on a PHP5 server. Everything works great, except for one thing. There's a particular routine that creates an...
2
by: Stefan Huber | last post by:
Hi I've got a really strange problem, and can't find out why it's not working as intended. in order to use php4 and 5 together on a webserver and the requirement for running as different...
12
by: Drazen Gemic | last post by:
How long will PHP4 be supported ? When is PHP4 end of life scheduled ? DG
3
by: doctorhardik | last post by:
hai all i am try configure php4.3.9 on my FC-3 machine. and my mysql database version 5.0.1, in phpinfo file it show mysql but when i run php -v command it show error like
8
by: FFMG | last post by:
Hi, I am slowly moving my code to php5. But I would like to make it backward compatible in case something bad happens, (and to make sure I understand what the changes are). The way the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.