[DOC] This is a concrete FilterIterator which takes a callback as
constructor parameter, and uses this callback for filtering. This allows
to use FilterIterator without extending it.
CallbackFilterIterator Example:
$it = new ArrayIterator(range(1,100));
$it = new CallbackFilterIterator($it, function($value) {
return $value % 2;
});
foreach($it as $value) // ...
RecursiveCallbackFilterIterator Example:
$it = new RecursiveDirectoryIterator("/");
$it = new RecursiveCallbackFilterIterator($it, function($file, $k, $it) {
return $it->hasChildren() || $file->getSize() > 1024;
});
foreach(new RecursiveIteratorIterator($it) as $file) // ...
The callback takes the current value, the current key and the inner
iterator as parameters.
# This is useful w/ distributors who like to build all things shared or don't
# provide the readline extension. Or if a user pefers readline's behavior over
# libedit which might be used by the distributor.
to be called as all the headers are being sent and after all
of the default headers have been merged.
headers_list(), header_remove() and header() can all be used
inside the callback.
<?php
header('Content-Type: text/plain');
header('X-Test: foo');
function foo() {
foreach (headers_list() as $header) {
if (strpos($header, 'X-Powered') !== false) {
header_remove('X-Powered-By');
}
header_remove('X-Test');
}
}
$result = header_register_callback('foo');
echo "a";
is pretty non-intuitive. If the same value was 1 or true you get a warning and it halts.
Since we can't break BC completely (yet) lets bump this from E_STRICT.
Also added a new section to UPGRADING for engine changes.
<?php
$x = '';
// $x = null;
// $x = false;
$x->baz = 1;
var_dump($x);
$y = 1;
$y->baz = 1;
var_dump($y);
do not support it).
I haven't written a test due to the need for such a test to have a HTTPS server
available which mishandles SessionTicket requests; it's likely that server
administrators will gradually fix this either intentionally or through OpenSSL
upgrades. That said, if there's a great clamoring for a test, I'll work one up.
# Note:
# Considering DTrace support: Why does it really need any configure time stuff?
# 3 macros for static stuff that could be made much cleaner with simple Makefile.dtrace
# addition. The only thing required in configure is that --enable flag part..
#
* Deprecated getrandmax() and mt_getrandmax() in favour of the new constants
# We should promote constants for static data like such instead of function calls
# maybe this was just an old left-over
. zend_function.pass_rest_by_reference is replaced by
ZEND_ACC_PASS_REST_BY_REFERENCE in zend_function.fn_flags
. zend_function.return_reference is replaced by ZEND_ACC_RETURN_REFERENCE
in zend_function.fn_flags
. zend_arg_info.required_num_args removed. it was needed only for internal
functions. Now the first arg_info for internal function (which has special
meaning) is represented by zend_internal_function_info structure.
. zend_op_array.size, size_var, size_literal, current_brk_cont,
backpatch_count moved into CG(context), because they are used only during
compilation.
. zend_op_array.start_op is moved into EG(start_op), because it's used
only for 'interactive' execution of single top-level op-array.
. zend_op_array.done_pass_two is replaced by ZEND_ACC_DONE_PASS_TWO in
zend_op_array.fn_flags.
. op_array.vars array is trimmed (reallocated) during pass_two.
. zend_class_entry.constants_updated is replaced by
ZEND_ACC_CONSTANTS_UPDATED in zend_class_entry.ce_flags
. the size of zend_class_entry is reduced by sharing the same memory space
by different information for internal and user classes.
See zend_class_inttry.info union.
. Added cli.pager ini setting to set a pager for output.
. Added cli.prompt ini settingto configure the shell prompt.
. Added shortcut #inisetting=value to change ini settings at run-time.
. Don't terminate shell on fatal errors.
A pager can be a an shell command which will receive the command output on its
STDIN channel
php > #cli.pager=less
php > phpinfo();
(output will appear in the pager)
php > #cli.pager=grep -i readline
php > phpcredits();
Readline => Thies C. Arntzen
php > #cli.pager=
(output appears again direct on the terminal)
A prompt can contain a few escape sequences like
php > #cli.prompt=\e[032m\v \e[031m\b \e[34m\> \e[0m
5.3.99-dev php > //Colorful prompt with version number
A prompt can also contaian PHP code in backticks
php > #cli.prompt=`echo gethostname();` \b \>
guybrush php >