You are here: Re: deleting all the files in a directory « PHP Programming Language « IT news, forums, messages
Re: deleting all the files in a directory

Posted by Andy Hassall on 02/15/06 23:18

On 15 Feb 2006 12:23:33 -0800, "Bart the bear" <bartthebear@gmail.com> wrote:

>Speaking of this, is there any chance of references to functions in
>PHP?

The closest is create_function() which isn't as good as Perl's ability to pass
code blocks, as you have to embed the anonymous function source in a string.

http://uk2.php.net/create_function

>Also, Perl has qr() construct which compiles regular expressions and
>makes
>things significantly faster. Is there any flag to compile regular
>expression in
>prreg_match?

Looking at the PHP source code, at least for PHP 5.1.2, it already compiles
expressions on first use and keeps the results in a cache - subsequent calls
use the cached compiled version. At least from a quick inspection of
ext/pcre/php_pcre.c, e.g. line 438, within php_pcre_match:

/* Compile regex or get it from cache. */
if ((re = pcre_get_compiled_regex(regex, &extra, &preg_options
TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

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

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