You are here: Re: Are PHP libraries linked dynamically or statically? « PHP Programming Language « IT news, forums, messages
Re: Are PHP libraries linked dynamically or statically?

Posted by Jerry Stuckle on 07/20/07 19:34

NC wrote:
> On Jul 20, 5:30 am, Martin Larsen <martin+spamfree+lar...@bigfoot.com>
> wrote:
>> I understand that PHP is very different than say a Windows
>> executable,
>
> PHP isn't (it can be a Windows executable). PHP scripts are.
>

Not quite true. The PHP interpreter (php.exe) itself is executable.
PHP scripts are just interpreted by the executable. The scripts
themselves are not executable.

The interpreter may statically or dynamically link to other libraries;
like other executables, statically linked libraries are handled at
compile time and become part of the executable. Dynamically linked
libraries are loaded at runtime.

But neither has any effect (other than a minor speed difference) on the
handling of the scripts (as long as the necessary libraries are available).

>> and perhaps linking is not the right term for what happens.
>
> Not at all. Here's an analogy. You have a word processor. Every
> time it starts, it loads every bit of code that has been statically
> linked during compilation. Every once in a while it may link to
> dynamic libraries if a document it loads or user input require it to
> do so. Documents, however, are not linked to anything in any way;
> they are only data that the program processes.
>
> With PHP, the PHP interpreter is the functional analog of the word
> processor (it is a program that processes user-submitted data); PHP
> scripts, functionally, are documents (user-submitted data); an include/
> require is akin to an instruction to include a subdocument into the
> main document.
>

Very good analogy.

>> Anyway, in your opinion, does the mechanism rememble dynamic
>> or static linking most?
>
> Neither. Static linking and dynamic linking are terms applicable only
> to compiled languages; in case of an interpreted language, they are
> only meaningful when applied to the interpreter, not to scripts it
> parses.
>
>> Btw, if I were to get an "official" statement, do you by
>> chance know who I should contact?
>
> The PHP group: http://www.php.net/contact.php
>
> Cheers,
> NC
>


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация