标签:namespace

浏览模式: 标准 | 列表 | 图文
yii 与 namespace

yii 与 namespace

Yii在import方面已经做的很好了,很多人都说Yii无法导入命名空间,事实上官方很早就给出过意见,如这里:http://www.yiiframework.com/doc/guide/1.1/zh_cn/basics.namespace,当然,这是中文版的

4. Namespace

不要将路径别名和名字空间混淆了,名字空间是指对一些类名的一个逻辑组合,这样它们就可以相互区分开,即使有相同的名字。 而路径别名是用于指向一个类文件或目录。路径别名与名字空间并不冲突。

提示: 由于 5.3.0 版本之前的 PHP 本质上不支持名字空间,你无法创建两个具有相同名字但不同定义的类的实例。 鉴于此,所有的 Yii 框架类都以字母 'C'(意为 'Class') 作前缀,这样它们可以区分于用户定义的类。我们建议前缀 'C' 只保留给 Yii 框架使用,用户定义的类则使用其他的字母作前缀。

5. 使用命名空间的类

使用命名空间的类是指一个在非全局命名空间下声明的类。比如说,类application\components\GoogleMap 在命名空间application\components下的类。使用命名空间需要 PHP 5.3.0 或者以上版本。

从1.1.5开始,可以无需显式引入而使用一个包含命名空间的类。比如说,我们可以创建一个application\components\GoogleMap 的实例而无需去处理引入的路径,这样就增强了Yii的自动导入机制。

若要自动导入使用命名空间的类,命名空间的格式必须和路径别名相似。比如说,类application\components\GoogleMap 所对应的路径必须和别名application.components.GoogleMap一致。

----------
如果仅看中文版,或许你还是看不懂,但你应该看英文版的,下面还有评论,你就知道怎么用了
评论是这个样子的,LOOK,http://www.yiiframework.com/doc/guide/1.1/en/basics.namespace:

Namespaces in a nutshell

Namespaces in php are like directory paths in console (bash, dos etc)
When you use namespace php keyword like this

namespace a\random\namespace;   class Foo {     static function bar(){}    }

is like executing cd a\specific\directory except that the namespace is created if not exists.
Now everything follows is belonging to that namespace. This means that if you want to instantiate, extend or call a static method from eg foo class on another namespace you have to

//The leading backslash '\' here denotes the global namespace that //is the root folder or C:\ counterpart from console environment  $baz= new \a\random\namespace\Foo;  class Fighter extends \a\random\namespace\Foo {} \a\random\namespace\Foo::bar();

Yii imports a very intuitive convention here that the namespace structure (if implemented) should be reflected on the physical directory structure and additionally makes its Path Alias convenience available for that purpose.
Please be my guest to follow these steps:
1. Create a new web app 2. Go to protected\components and create a folder foo 3. Move Controller.php in foo folder and open it with an editor 4. At line 6, at Controller class declaration import this:

namespace application\components\foo; class Controller extends \CController //Note the leading backslash here
  1. Now open protected\controllers\SiteController.php for editing
  2. Replace the SiteController class declaration with this
class SiteController extends \application\components\foo\Controller

As you will see, your new web app still working fine and application path alias will point properly at protected folder.
You can find more about php namespaces here
Enjoy coding :>

--------
果然,这年头,英文版的资料比中文版多多了,手册上也是,不过PHP手册是一定要带评论,对于我们这些初学者来说,那是相当的有用啊

Oauth二三事

Oauth二三事

这两天在做微博同步,于是对于oauth又重新开始折腾了。其实在之前我也做过类似的笔记,例如这个 关于oauth的几篇文章 ,于是在做这个同步的时候也参考了这些其中的一两篇,比如老王的基于PECL OAuth打造微博应用,但由于我不想加载pecl的oauth库,所以就不能使用了。
于是我就根据官方的SDK进行了处理,但由于需要同时支持两个或更多微博,结果就造成了oauth类的冲突了。而事实上经过测试,还不能加载一个屏蔽一个,因为有些微博对oauth类中的部分做了修改。于是最后我采用了namespace来解决了这个问题。
因为这次我是把weibo的类库做了独立处理,但由于不是每一台服务器都支持5.3的namespace,也在犹豫是不是要重新修正oauth类,但这样之后,官方的SDK我就不能覆盖性的更新了。真纠结呀。
hightman也在重写类似的东西,大家都在重复造轮子,可是怎么办呢?官方万一更新SDK,添加了新接口,我们怎么办,虽然会有一些接口的URL提供我们调用,但总归是直接使用会更方便啦。随便说说而已,目前已经解决,实在吐血的情况下那我就是干脆自己学着新浪他们一样也提供接口。哈哈,做点无耻的事情。。。

php simplexmlElement 操作xml的命名空间

php simplexmlElement 操作xml的命名空间

这是今天中午发生的事情,有人在群里求助,比如xml中如果标记是<xx:xxxx>content</xx:xxxx>这样的情况下,取不到 xx:xxxx 为下标的值。
看了这个问题,第一个反应就是namespace的关系,但我从来没有使用simplexml操作过namespace,于是就翻开手册查了一下资料,问题并没有解决,最终是通过google解决了该问题。

提问题的朋友贴出了数据源,来自于:http://code.google.com/intl/zh-CN/apis/contacts/docs/3.0/developers_guide_protocol.html#retrieving_without_query,数据结构大致如下:

<feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:gContact='http://schemas.google.com/contact/2008' xmlns:batch='http://schemas.google.com/gdata/batch' xmlns:gd='http://schemas.google.com/g/2005' gd:etag='W/"CUMBRHo_fip7ImA9WxRbGU0."'>
<id>liz@gmail.com</id>
<updated>2008-12-10T10:04:15.446Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact' />
<title>Elizabeth Bennet's Contacts</title>
<link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/liz%40gmail.com/full' />
<link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/liz%40gmail.com/full' />
<link rel='http://schemas.google.com/g/2005#batch' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/liz%40gmail.com/full/batch' />
<link rel='self' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/liz%40gmail.com/full?max-results=25' />
<author>
<name>Elizabeth Bennet</name>
<email>liz@gmail.com</email>
</author>
<generator version='1.0' uri='http://www.google.com/m8/feeds'> Contacts </generator>
<openSearch:totalResults>1</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>25</openSearch:itemsPerPage>
<entry gd:etag='"Qn04eTVSLyp7ImA9WxRbGEUORAQ."'>
<id> http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base/c9012de </id>
<updated>2008-12-10T04:45:03.331Z</updated>
<app:edited xmlns:app='http://www.w3.org/2007/app'>2008-12-10T04:45:03.331Z</app:edited>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact' />
<title>Fitzwilliam Darcy</title>
<gd:name>
<gd:fullName>Fitzwilliam Darcy</gd:fullName>
</gd:name>
<link rel='http://schemas.google.com/contacts/2008/rel#photo' type='image/*' href='https://www.google.com/m8/feeds/photos/media/liz%40gmail.com/c9012de' gd:etag='"KTlcZWs1bCp7ImBBPV43VUV4LXEZCXERZAc."' />
<link rel='self' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/liz%40gmail.com/full/c9012de' />
<link rel='edit' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/liz%40gmail.com/full/c9012de' />
<gd:phoneNumber rel='http://schemas.google.com/g/2005#home' primary='true'> 456 </gd:phoneNumber>
<gd:extendedProperty name='pet' value='hamster' />
<gContact:groupMembershipInfo deleted='false' href='http://www.google.com/m8/feeds/groups/liz%40gmail.com/base/270f' />
</entry>
</feed>

这个结构在上面的地址里有,这个是我格式化过的XML数据,现在要取得类似于“<gd:phoneNumber rel='http://schemas.google.com/g/2005#home' primary='true'> 456 </gd:phoneNumber> ”中的值。

最终代码如下:

$x = new SimpleXmlElement($str);
foreach($x->entry as $t){
echo $t->id . "<br >";
echo $t->updated . "<br />";
$namespaces = $t->getNameSpaces(true);
$gd = $t->children($namespaces['gd']);
echo $gd->phoneNumber;
}

当然,如果不象上面这样写,也可以写成这样:

$x = new SimpleXmlElement($str);
foreach($x->entry as $t){
echo $t->id . "<br >";
echo $t->updated . "<br />";
//$namespaces = $t->getNameSpaces(true);
//注意这里与上面一段的区别
$gd = $t->children('http://schemas.google.com/g/2005');
echo $gd->phoneNumber;
}

只是象第二种写法就属于硬编码了,这样不太好,万一哪天有变化,还得再更改N多代码。
问题接踵而来,比如象下面这段:

<event:event>
<event:sessionKey></event:sessionKey>
<event:sessionName>Learn QB in Minutes</event:sessionName>
<event:sessionType>9</event:sessionType>
<event:hostWebExID></event:hostWebExID>
<event:startDate>02/12/2009</event:startDate>
<event:endDate>02/12/2009</event:endDate>
<event:timeZoneID>11</event:timeZoneID>
<event:duration>30</event:duration>
<event:description></event:description>
<event:status>NOT_INPROGRESS</event:status>
<event:panelists></event:panelists>
<event:listStatus>PUBLIC</event:listStatus>
</event:event>

这种非标准的XML,没有定义命名空间,怎么办?在这种情况下,其实SimpleXmlElement就已经直接可以解决了,但是会报warnging,因为他认为event这个命名空间不存在。
解决方法是:

$xml = @new SimpleXmlElement($str);//在前面加@抑止错误。
echo "<pre>";
print_r($xml);

目前看来,这种解决方法比较好。

杂烩,附招聘信息

杂烩,附招聘信息

项目中用到了memcached,类文件是不知道谁找来的MemcacheWrapper,其中有一个方法是namespace(),在正式机上跑的没问题,但是测试机上却老是显示语法有误,说是T_STRING没有正确结尾。开始的时候以为是文件编码导致,但仔细一看,原来是这个namespace名称,但为什么正式机上没问题呢?翻开手册才知道,这个名词是从5.3才开始变成关键字的。这让我想起了一些其他的名称,比如use,goto,import等 。自从命名空间开始后,很多人都认为import会变成关键字,但结果还是采用了use作为关键字。

因此,在写代码的时候,可以看一下PHP附录的保留关键字等。

-------------------------------

一号店,是11在群里说的,说是这个网店吸引了风投,但我看了看,没有什么特别的地方,连京东都可以卖非电器类产品了,这类网站那怎么赢利呢?事实上华联等都有网站,而且送货费也不贵,所以,随便看看喽。。观望一下

-------------------------------

最后,给自己现在的单位进行一下招聘。

条件我也不多说了,总之是PHP方面的人才,一些附加条件我也就多说了,什么精通这个精通那个的。

只有几个条件:1年PHP开发经验的2名,2年+开发经验的2名。1年左右经验的,最基本的CRUD要会,顺便熟悉康盛的系统为佳。2年+的,需要有独立做项目的经验,能够根据需求独立完成项目,当然也不希望是算盘珠一样,一定要有自己的想法才行。

然后就是大家都要求的,性格开朗,有团队经验犹佳之类。那句能够承受加班压力的我就不写了,项目一般不会要求加班,只希望在工作时间把任务完成,这是最佳的。要加班的话,也就是上线前几天和上线后几天,可能会有加班情况出现,但这个,其实大家都懂的吧。

请身在上海,并有意愿从事PHP和已经从事PHP但想換換岗位的可以联系我。可以留言,也可以QQ我:19129540.

PHP的命名空间真这么糟糕么?

PHP的命名空间真这么糟糕么?

PHP的命名空间啊。被很多人所诟病,理由就是那个反斜杠。被当成转义符的反斜杠承担起了命名空间的重任。可想而知,他承受的压力有多大。。。

还好,还是有人在支持的,以下就是一篇支持文章,翻译过的。翻译人当然不是我,我要会翻译也就不写程序了。去翻译点文章忽悠人了。

原文如下,来自于:http://www.mikespook.com/index.php/archives/394

几年前(大约应该在02-03年之间,也就是php5刚出来那会)曾经跟朋友讨论过一次关于php的命名空间的问题。当时觉得,php要是能有命名空间,那是多完美的事情啊。
如今,php5.3已经包含了命名空间。但是似乎并没有当年的那种感慨了。大约是旧的系统要迁移,新的系统要重新设计,这个名字空间都有点鸡肋的感觉。看来还要习惯一下才好。
看到这篇文章,觉得说得是有点对的。也不长,就随手翻译出来。翻译后的感觉:作者 超级喜欢使用“However”。
能说明两个问题:

  1. php本身为什么是这样
  2. php的名字空间为什么是这样

作者:Craig Buckler
原文:http://www.sitepoint.com/blogs/2009/08/13/are-php-namespaces-bad/
207ce891440a9ad60d2de6d6a9a47aeb

PHP开发者对于PHP中命名空间的实现,已经变得异常的渴望。当PHP应用开始变得巨大,并且更加复杂的时候,命名空间是解决代码冲突的必要手段。
我最近的一些指南收到了大量关于PHP的命名空间实现的评论。问题主要集中在语法和反斜杠上面。在解决这些问题之前,让我们先来快速回顾一下PHP的历史。

混乱的PHP

像C#和Java这些语言,是被设计和遵循严格的语法标准的。PHP是演化的。最早的版本发布于1995年,版本号3,是面向过程的语言。版本4包含了最基本的面向对象,而版本5提供了合适的标准OOP模型。命名空间在版本5.3被加入其中。

PHP批评者声明说这个语言是混乱的。函数名不一致(例如strpos,str_split,substr),对象处理是无用的,还有一些语法同其他语言相比,不是极其怪诞,就是异乎寻常。

然而,PHP仍然保持着使用最广泛的服务器端开发语言的头把交椅。它的才华主要在下面的长处:

  • 初学者可以从简单的面向过程编程开始。他们无须触及OOP技术仍然可以有所见数。
  • 10年前为PHP 3编写的代码仍然可以运行在PHP 5.3下。可能需要一些微小的调整,但是很少需要大量重写。

PHP代码可能并不总是可爱的、有逻辑的或者优雅的,但是相比其他选择它的开发总是快捷和容易被理解的。

PHP命名空间的实现

不像C#和Java,PHP不得不保持没有名字空间代码的兼容性。这个已经被实现,你可以选择使用或者不使用命名空间。然而,如果你使用PHP 5.3或更高版本,我推荐使用命名空间,即使你在项目中只使用相同的名字。

使用namespace和use作为命名空间操作符看起来很有逻辑。一些开发者可能不同意,但是在这种情况下它们如何命名其实并不重要。

最后,回到反斜杠的问题上。多数批评者人为这是丑陋的,难以阅读,并且在Mac上难以输入。即便如此,我仍然认为它比曾经提议过的两个冒号要好。例如下面的静态方法调用:

// PHP 5.3 beta版静态方法调用
echo ::App::Lib1::MyClass::WhoAmI();
// PHP 5.3正式版静态方法调用
echo \App\Lib1\MyClass::WhoAmI();

第二行可以被快速录入,更少的错误可能,容易阅读,并且容易理解。如果你在字符串之外看到反斜杠,你就知道那一定存在命名空间。

当然,如果PHP使用“.”作为公共方法、静态方法和命名空间会更好。这样可以同Java、C#、JavaScript、Python和许多其他语言一致起来。不幸的是PHP的历史和向下兼容让这一切难以实现。

没有语言是完美的,而PHP更加不会是完美语言中的一员。无论如何,命名空间已经被很好的实现,特别是考虑到它可能产生的限制和问题。我相信你一定会学习并且着迷那个反斜杠的。

相关阅读:

PHP5.30的更新列表

PHP5.30的更新列表

啥也不说了。自己看列表吧。。原来,更新了这么多啊。。。。。。现在还是alpha,等到了stable,那我应该不应该更新呢》》》

PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 200?, PHP 5.3.0 Alpha 2
- Removed shebang line check from CGI sapi (it is checked by scanner) (Dmitry)

- Fixed bug #45696 (Not all DateTime methods allow method chaining). (Derick)
- Fixed bug #45545 (DateInterval has a limitation of 4 chars for ISO
durations). (Derick)
- Fixed bug #45406 (session.serialize_handler declared by shared extension
fails). (Kalle, oleg dot grenrus at dynamoid dot com)
- Fixed bug #44100 (Inconsistent handling of static array declarations with
duplicate keys). (Dmitry)
- Fixed bug #43008 (php://filter uris ignore url encoded filternames and can't
handle slashes). (Arnaud)

01 Aug 2008, PHP 5.3.0 Alpha 1
- Upgraded bundled PCRE to version 7.7. (Nuno)
- Upgraded bundled PDO sqlite to version 3.5.9. (Scott)

- Moved extensions to PECL (Pierre):
. ext/fdf
. ext/ncurses
. ext/sybase (not maintained anymore, sybase_ct has to be used instead)

- Removed the experimental RPL (master/slave) functions from mysqli. (Andrey)
- Removed zend.ze1_compatibility_mode. (Dmitry)
- Deprecated ticks support. (Felipe)

- Changed PCRE, Reflection and SPL extensions to be always enabled. (Marcus)
- Changed md5() to use improved implementation. (Solar Designer, Dmitry)
- Changed HTTP stream wrapper to accept any code between and including
200 to 399 as successful. (Mike, Noah Fontes)

- Improved PHP syntax and semantics:
. Added lambda functions and closures. (Christian Seiler, Dmitry)
. Added "jump label" operator (limited "goto"). (Dmitry, Sara)
. Added NOWDOC syntax. (Gwynne Raskind, Stas, Dmitry)
. Added HEREDOC syntax with double quotes. (Lars Strojny, Felipe)
. Added support for using static HEREDOCs to initialize static variables and
class members or constants. (Matt)
. Improved syntax highlighting and consistency for variables in double-quoted
strings and literal text in HEREDOCs and backticks. (Matt)
. Added "?:" operator. (Marcus)
. Added support for namespaces. (Dmitry, Stas, Gregory)
. Added support for Late Static Binding. (Dmitry, Etienne Kneuss)
. Added support for __callStatic() magic method. (Sara)
. Added forward_static_call(_array) to complete LSB. (Mike Lively)
. Added support for dynamic access of static members using $foo::myFunc().
(Etienne Kneuss)
. Improved checks for callbacks. (Marcus)
. Added __DIR__ constant. (Lars Strojny)
. Added PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION,
PHP_EXTRA_VERSION, PHP_VERSION_ID, PHP_ZTS and PHP_DEBUG constants.
(Pierre)
. Added new error modes E_USER_DEPRECATED and E_DEPRECATED.
E_DEPRECATED is used to inform about stuff being scheduled for removal
in future PHP versions. (Lars Strojny, Felipe, Marcus)
. Added "request_order" INI variable to control specifically $_REQUEST
behavior. (Stas)
. Added support for exception linking. (Marcus)
. Added ability to handle exceptions in destructors. (Marcus)

- Improved PHP runtime speed and memory usage:
. Substitute persistent constants by their values at compile time. (Matt)
. Optimized ZEND_SIGNED_MULTIPLY_LONG(). (Matt)
. Removed direct executor recursion. (Dmitry)
. Use fastcall calling convention in executor on x86. (Dmitry)
. Use IS_CV for direct access to $this variable. (Dmitry)
. Use ZEND_FREE() opcode instead of ZEND_SWITCH_FREE(IS_TMP_VAR). (Dmitry)
. Lazy EG(active_symbol_table) initialization. (Dmitry)
. Optimized ZEND_RETURN opcode to not allocate and copy return value if it is
not used. (Dmitry)
. Replaced all flex based scanners with re2c based scanners.
(Marcus, Nuno, Scott)
. Added garbage collector. (David Wang, Dmitry).
. Improved PHP binary size and startup speed with GCC4 visibility control.
(Nuno)
. Improved engine stack implementation for better performance and stability.
(Dmitry)
. Improved memory usage by moving constants to read only memory.
(Dmitry, Pierre)
. Changed exception handling. Now each op_array doesn't contain
ZEND_HANDLE_EXCEPTION opcode in the end. (Dmitry)
. Optimized require_once() and include_once() by eliminating fopen(3) on
second usage. (Dmitry)
. Optimized ZEND_FETCH_CLASS + ZEND_ADD_INTERFACE into single
ZEND_ADD_INTERFACE opcode. (Dmitry)
. Optimized string searching for a single character.
(Michal Dziemianko, Scott)
. Optimized interpolated strings to use one less opcode. (Matt)

- Improved php.ini handling: (Jani)
. Added ".htaccess" style user-defined php.ini files support for CGI/FastCGI.
. Added support for special [PATH=/opt/httpd/www.example.com/] and
[HOST=www.example.com] sections. Directives set in these sections can
not be overridden by user-defined ini-files or during runtime.
. Added better error reporting for php.ini syntax errors.
. Allowed using full path to load modules using "extension" directive.
. Allowed "ini-variables" to be used almost everywhere ini php.ini files.
. Allowed using alphanumeric/variable indexes in "array" ini options.
. Added 3rd optional parameter to parse_ini_file() to specify the scanning
mode of INI_SCANNER_NORMAL or INI_SCANNER_RAW. In raw mode option values
and section values are treated as-is.
. Fixed get_cfg_var() to be able to return "array" ini options.
. Added optional parameter to ini_get_all() to only retrieve the current
value. (Hannes)

- Improved and cleaned CGI code:
. FastCGI is now always enabled and can not be disabled.
See sapi/cgi/CHANGES for more details. (Dmitry)
. Added CGI SAPI -T option which can be used to measure execution
time of script repeated several times. (Dmitry)

- Improved streams:
. Fixed confusing error message on failure when no errors are logged. (Greg)
. Added stream_supports_lock() function. (Benjamin Schulz)
. Added "ignore_errors" option to http fopen wrapper. (David Zulke, Sara)
. Added context parameter for copy() function. (Sara)
. Added "glob://" stream wrapper. (Marcus)
. Added "params" as optional parameter for stream_context_create(). (Sara)
. Added ability to use stream wrappers in include_path. (Gregory, Dmitry)

- Improved hash extension:
. Changed mhash to be a wrapper layer around the hash extension. (Scott)
. Added hash_copy() function. (Tony)
. Added sha224 hash algorithm to the hash extension. (Scott)

- Improved mbstring extension:
. Added "mbstring.http_output_conv_mimetypes" INI directive that allows
common non-text types such as "application/xhtml+xml" to be converted
by mb_output_handler(). (Moriyoshi)

- Improved OCI8 extension (Chris Jones/Oracle Corp.):
. Added Database Resident Connection Pooling (DRCP) and Fast
Application Notification (FAN) support.
. Added support for Oracle External Authentication (not supported
on Windows).
. Improve persistent connection handling of restarted DBs.
. Added SQLT_AFC (aka CHAR datatype) support to oci_bind_by_name.
. Fixed bug #41069 (Seg fault with query over DB link).
. Fixed define of SQLT_BDOUBLE and SQLT_BFLOAT constants with Oracle
10g ORACLE_HOME builds.
. Changed default value of oci8.default_prefetch from 10 to 100.
. Fixed PECL bug #12431 (OCI8 ping functionality is broken).
. Allow building (e.g from PECL) the PHP 5.3-based OCI8 code with
PHP 4.3.9 onwards.

- Improved OpenSSL extension: (Dmitry)
. Added support for OpenSSL digest and cipher functions.
. Added access to internal values of DSA, RSA and DH keys.

- Improved pcntl extension: (Arnaud)
. Added pcntl_signal_dispatch().
. Added pcntl_sigprocmask().
. Added pcntl_sigwaitinfo().
. Added pcntl_sigtimedwait().

- Improved SOAP extension:
. Added support for element names in context of XMLShema's <any>. (Dmitry)
. Added ability to use Traversable objects instead of plain arrays.
(Joshua Reese, Dmitry)
. Fixed possible crash bug caused by an uninitialized value. (Zdash Urf)

- Improved SPL extension:
. Added SPL to list of standard extensions that cannot be disabled. (Marcus)
. Added ability to store associative information with objects in
SplObjectStorage. (Marcus)
. Added ArrayAccess support to SplObjectStorage. (Marcus)
. Added SplDoublyLinkedList, SplStack, SplQueue classes. (Etienne)
. Added FilesystemIterator. (Marcus)
. Added GlobIterator. (Marcus)
. Added SplHeap, SplMinHeap, SplMaxHeap, SplPriorityQueue classes. (Etienne)
. Added new parameter $prepend to spl_autoload_register(). (Etienne)
. Added FixedArray. (Etienne, Tony)
. Added delaying exceptions in SPL's autoload mechanism. (Marcus)
. Added RecursiveTreeIterator. (Arnaud, Marcus)
. Added MultipleIterator. (Arnaud, Marcus, Johannes)

- Improved Zend Engine:
. Added "compact" handler for Zend MM storage. (Dmitry)
. Added "+" and "*" specifiers to zend_parse_parameters(). (Andrei)
. Added concept of "delayed early binding" that allows opcode caches to
perform class declaration (early and/or run-time binding) in exactly
the same order as vanilla PHP. (Dmitry)

- Improved crypt() function: (Pierre)
. Added Blowfish and extended DES support. (Using Blowfish implementation
from Solar Designer).
. Made crypt features portable by providing our own implementations
for crypt_r and the algorithms which are used when OS does not provide
them. PHP implementations are always used for Windows builds.

- Added new extensions:
. Added fileinfo extension as replacement for mime_magic extension. (Derick)
. Added intl extension for Internationalization. (Ed B., Vladimir I.,
Dmitry L., Stanislav M., Vadim S., Kirti V.)
. Added mysqlnd extension as replacement for libmysql for ext/mysql, mysqli
and PDO_mysql. (Andrey, Johannes, Ulf)
. Added phar extension for handling PHP Archives. (Greg, Marcus, Steph)
. Added SQLite3 extension. (Scott)

- Added new date/time functionality: (Derick)
. date_parse_from_format(): Parse date/time strings according to a format.
. date_create_from_format()/DateTime::createFromFormat(): Create a date/time
object by parsing a date/time string according to a given format.
. date_get_last_errors()/DateTime::getLastErrors(): Return a list of warnings
and errors that were found while parsing a date/time string through:
. strtotime() / new DateTime
. date_create_from_format() / DateTime::createFromFormat()
. date_parse_from_format().
. support for abbreviation and offset based timezone specifiers for
DateTime::getOffset() and DateTime::getName().
. support for selectively listing timezone identifiers by continent or
country code through timezone_identifiers_list() /
DateTimezone::listIdentifiers().
. timezone_location_get() / DateTimezone::getLocation() for retrieving
location information from timezones.
. date_timestamp_set() / DateTime::setTimestamp() to set a Unix timestamp
without invoking the date parser. (Scott, Derick)
. date_timestamp_get() / DateTime::getTimestamp() to retrieve the Unix
timestamp belonging to a date object.
. two optional parameters to timezone_transitions_get() /
DateTimeZone::getTranstions() to limit the range of transitions being
returned.
. support for "first/last day of <month>" style texts.
. support for date/time strings returned by MS SQL.
. support for serialization and unserialization of DateTime objects.
. support for diffing date/times through date_diff() / DateTime::diff().
. support for adding/subtracting weekdays with strtotime() and
DateTime::modify().
. DateInterval class to represent the difference between two date/times.
. support for parsing ISO intervals for use with DateInterval.
. date_add() / DateTime::add(), date_sub() / DateTime::sub() for applying an
interval to an existing date/time.
. proper support for "this week", "previous week"/"last week" and "next week"
phrases so that they actually mean the week and not a seven day period
around the current day.
. support for "<xth> <weekday of" and "last <weekday> of" phrases to be used
with months - like in "last saturday of februari 2008".
. DatePeriod class which supports iterating over a DateTime object applying
DateInterval on each iteration, up to an end date or limited by maximum
number of occurences.

- Added array_replace() and array_replace_recursive() functions. (Matt)
- Added ReflectionProperty::setAccessible() method that allows non-public
property's values to be read through ::getValue(). (Derick)
- Added msg_queue_exists() function to sysvmsg extension. (Benjamin Schulz)
- Added Firebird specific attributes that can be set via PDO::setAttribute()
to control formatting of date/timestamp columns: PDO::FB_ATTR_DATE_FORMAT,
PDO::FB_ATTR_TIME_FORMAT and PDO::FB_ATTR_TIMESTAMP_FORMAT. (Lars W)
- Added gmp_testbit() function. (Stas)
- Added icon format support to getimagesize(). (Scott)
- Added LDAP_OPT_NETWORK_TIMEOUT option for ldap_set_option() to allow
setting network timeout (FR #42837). (Jani)
- Added optional escape character parameter to fgetcsv(). (David Soria Parra)
- Added an optional parameter to strstr() and stristr() for retrieval of either
the part of haystack before or after first occurrence of needle.
(Johannes, Felipe)
- Added xsl->setProfiling() for profiling stylesheets. (Christian)
- Added long-option feature to getopt() and made getopt() available also on
win32 systems by adding a common getopt implementation into core.
(David Soria Parra, Jani)
- Added support for optional values, and = as separator, in getopt(). (Hannes)
- Added lcfirst() function. (David C)
- Added PREG_BAD_UTF8_OFFSET_ERROR constant. (Nuno)
- Added native support for asinh(), acosh(), atanh(), log1p() and expm1().
(Kalle)
- Added inet_pton() and inet_ntop() also for Windows platforms. (Kalle)
- Added mcrypt_create_iv() also for Windows platforms. (Pierre)

- Fixed html_entity_decode() incorrectly converting numeric html entities
to different characters with cp1251 and cp866. (Scott)
- Fixed an issue in date() where a : was printed for the O modifier after a P
modifier was used. (Derick)
- Fixed exec() on Windows to not eat the first and last double quotes. (Scott)

- Fixed PECL bug #12794 (PDOStatement->nextRowset() doesn�t work). (Johannes)
- Fixed PECL bug #12401 (Add support for ATTR_FETCH_TABLE_NAMES). (Johannes)

- Fixed bug #45622 (isset($arrayObject->p) misbehaves with ArrayObject::
ARRAY_AS_PROPS set). (robin_fernandes at uk dot ibm dot com, Arnaud)
- Fixed bug #45614 (ArrayIterator::current(), ::key() can show 1st private
prop of wrapped object). (robin_fernandes at uk dot ibm dot com, Arnaud)
- Fixed bug #45571 (ReflectionClass::export() shows superclasses' private
static methods). (robin_fernandes at uk dot ibm dot com)
- Fixed bug #45540 (stream_context_create creates bad http request). (Arnaud)
- Fixed bug #45430 (windows implementation of crypt is not thread safe).
(Pierre)
- Fixed bug #45345 (SPLFileInfo::getPathInfo() returning dir info instead of
file info). (Etienne)
- Fixed bug #45179 (--with-mysql-sock fails to compile & work). (Andrey)
- Fixed bug #45038 (Crash when using DateTimeZone object returned by
Date::getTimezone). (Joe Orton, Derick)
- Fixed bug #44769 (declaring private magic methods should throw error).
(Felipe)
- Fixed bug #44913 (Segfault when using return in combination with nested loops
and continue 2). (Dmitry)
- Fixed bug #44899 (__isset usage changes behavior of empty()). (Etienne)
- Fixed bug #44897 (failed to prepare statement). (Andrey)
- Fixed bug #44849 (imagecolorclosesthwb() is not available on Windows).
(Kalle)
- Fixed bug #44805 (rename() function is not portable to Windows). (Pierre)
- Fixed bug #44779 (filter returns NULL in CLI when it shouldn't). (Arnaud)
- Fixed bug #44742 (timezone_offset_get() causes segmentation faults). (Derick)
- Fixed bug #44660 (Indexed and reference assignment to propery of non-object
don't trigger warning). (Dmitry)
- Fixed bug #44648 (Attribute names not checked for wellformedness). (Rob)
- Fixed bug #44414 (Incomplete reporting about abstract methods). (Dmitry)
- Fixed bug #44390 (mysqli_bind_param/bind_result and Object member variables).
(Andrey)
- Fixed bug #44352 (mysqli_connect_error() false negative for host errors).
(Andrey)
- Fixed bug #44336 (Improve pcre UTF-8 string matching performance).
(frode at coretrek dot com, Nuno)
- Fixed bug #44301 (Segfault when an exception is thrown on persistent
connections). (Martin Jansen)
- Fixed bug #44257 (timelib_tz_lookup_table must use float for gmtoffset).
(Derick, iuri dot fiedoruk at hp dot com).
- Fixed bug #44214 (Crash using preg_replace_callback() and global variable).
(Nuno, Scott)
- Fixed bug #44034 (FILE_IGNORE_NEW_LINES in file() does not work as expected
when lines end in \r\n). (Ilia)
- Fixed bug #43960 (strtotime() returns timestamp in the future when given a
bogus string). (Derick)
- Fixed bug #43832 (mysqli_get_charset() doesn't expose charset comment).
(Andrey)
- Fixed bug #43808 (date_create never fails (even when it should)). (Derick)
- Fixed bug #43527 (DateTime created from a timestamp reports environment
timezone). (Derick)
- Fixed bug #43452 (strings containing a weekday, or a number plus weekday
misbehaved if the current day-of-week was same as the one in the phrase).
(Derick)
- Fixed bug #43426 (crash on nested call_user_func() calls). (Dmitry)
- Fixed bug #43323 (Wrong count abstract methods). (Felipe, Dmitry)
- Fixed bug #43261 (Use ^ as the escape with escapeshellcmd() on Windows).
(Scott)
- Fixed bug #43075 (Support 2007-11-01T24:00:00+00:00). (Derick)
- Fixed bug #43003 (Invalid timezone reported for DateTime objects constructed
using a timestamp). (Derick)
- Fixed bug #43143 (Warning about empty IV with MCRYPT_MODE_ECB). (Derick)
- Fixed bug #43136 (possible crash on script execution timeout.
The EG(function_state_ptr) is completely removed,
EG(current_execute_data)->function_state must be used instead). (Dmitry)
- Fixed bug #42952 (soap cache file is created with insecure permissions).
(Dmitry)
- Fixed bug #42868 (Floats cast to integer produce unpredictable results).
(Zoe Slattery)
- Fixed bug #42848 (Status: header incorrect under FastCGI). (Dmitry)
- Fixed bug #42773 (WSDL error causes HTTP 500 Response). (Dmitry)
- Fixed bug #42737 (preg_split('//u') triggers a E_NOTICE with newlines).
(Nuno)
- Fixed bug #42736 (xmlrpc_server_call_method() crashes). (Tony)
- Fixed bug #42663 (gzinflate() try to allocate all memory with truncated
data). (Arnaud)
- Fixed bug #42657 (ini_get() returns incorrect value when default is NULL).
(Jani, Scott)
- Fixed bug #42637 (SoapFault : Only http and https are allowed). (Bill Moran)
- Fixed bug #42548 (mysqli PROCEDURE calls can't return result sets). (Hartmut)
- Fixed bug #42509 (gmp leaks memory when gmp_init() not used). (Stas)
- Fixed bug #42499 (PDO_MYSQL: multi-statement execution via PDO::exec() makes
connection unusable). (Johannes)
- Fixed bug #42443 (PDO SQLite driver binds integers and booleans as strings).
(Scott)
- Fixed bug #42284 (duplicate of #39700). (Lars W)
- Fixed bug #42203 (Clear SQLite result sets before closing database). (Scott)
- Fixed bug #42190 (Constructing DateTime with TimeZone Indicator invalidates
DateTimeZone). (Derick)
- Fixed bug #42069 (parse_ini_file() allows using some non-alpha numeric
characters). (Jani)
- Fixed bug #41997 (pdo_mysql: stored procedure call returning single rowset
blocks future queries). (Johannes)
- Fixed bug #41996 (Problem accessing Oracle ROWID). (Martin Jansen)
- Fixed bug #41599 (setTime() fails after modify() is used). (Derick)
- Fixed bug #41522 (PDO firebird driver returns null if it fails to connect).
(Lars W)
- Fixed bug #41135 (PDO SQLite driver binds blobs as strings,
use sqlite3_bind_blob() to stop errors with null bytes). (Scott)
- Fixed bug #39822 (new PDO() doesn't work with firebird). (Lars W)
- Fixed bug #39700 (NUMERIC error when result precision are 7,8 or 12-14 ).
(Lars W)
- Fixed bug #39457 (Multiple invoked OO connections never close). (Andrey)
- Fixed bug #39397 (invalid statement handle in Unknown on line 0). (Lars W)
- Fixed bug #39346 (Unsetting a static variable inside a destructor causes
segfault later on). (Dmitry)
- Fixed bug #39127 (Old-style constructor fallbacks produce strange results).
(Tony)
- Fixed bug #39056 (Interbase NUMERIC data type error). (Lars W)
- Fixed bug #39018 (Error control operator '@' fails to suppress "Uninitialized
string offset"). (Felipe)
- Fixed bug #38468 (Unexpected creation of cycle). (Dmitry)
- Fixed bug #37964 (Reflection shows private methods of parent class).
(Felipe, Marcus)
- Fixed bug #37911 (preg_replace_callback() ignores named groups). (Nuno)
- Fixed bug #37076 (SimpleXML ignores .=). (Felipe, Marcus)
- Fixed bug #36128 (Interbase PDO - timestamp columns return NULL). (Lars W)
- Fixed bug #35386 (firebird: first row is null). (Lars W)
- Fixed bug #35163 (Array elements can lose references). (Dmitry)
- Fixed bug #32330 (session_destroy, "Failed to initialize storage module",
custom session handler). (Gwynne)
- Fixed bug #32143 (ibase_query() causing IBserver 7 crash with NULL param as
link-id). (Lars W)
- Fixed bug #30907 (ibase_query() crashes (same bug as #32143). (Lars W)
- Fixed bug #30690 (Resource handle from ibase_execute becomes invalid after
return). (Lars W)
- Fixed bug #29044 (compact() does not have infinite recursion protection).
(Tony)
- Fixed bug #27372 (parse error loading browscap.ini at apache startup).
(Jani)