Browse Source
Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src: fix the fix fix for bug #63530 mysqlnd_stmt::bind_one_parameter uses wrong alloc for stmt->param_bind Forgot to remove some now unused variables Add support for non-scalar Iterator keys in foreach fixed headers order - Updated to version 2013.2 (2013b) fixed the test Fixed bug #64370 (microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT']) Disable zend_always_inline in debug buildpull/288/merge
46 changed files with 1098 additions and 1222 deletions
-
5NEWS
-
2UPGRADING
-
8UPGRADING.INTERNALS
-
52Zend/tests/generators/generator_with_nonscalar_keys.phpt
-
7Zend/zend.h
-
34Zend/zend_API.c
-
2Zend/zend_API.h
-
24Zend/zend_generators.c
-
18Zend/zend_hash.c
-
4Zend/zend_hash.h
-
38Zend/zend_interfaces.c
-
2Zend/zend_interfaces.h
-
7Zend/zend_iterators.h
-
1Zend/zend_types.h
-
70Zend/zend_vm_def.h
-
70Zend/zend_vm_execute.h
-
9ext/com_dotnet/com_iterator.c
-
9ext/com_dotnet/com_saproxy.c
-
1209ext/date/lib/timezonedb.h
-
7ext/date/php_date.c
-
27ext/dom/dom_iterators.c
-
10ext/intl/breakiterator/breakiterator_iterators.cpp
-
14ext/intl/common/common_enum.cpp
-
13ext/intl/resourcebundle/resourcebundle_iterator.c
-
5ext/mysqli/mysqli_result_iterator.c
-
2ext/mysqlnd/mysqlnd_ps.c
-
9ext/pdo/pdo_stmt.c
-
20ext/pdo_mysql/mysql_statement.c
-
50ext/phar/phar_object.c
-
27ext/simplexml/simplexml.c
-
19ext/soap/php_encoding.c
-
24ext/spl/spl_array.c
-
20ext/spl/spl_directory.c
-
5ext/spl/spl_dllist.c
-
8ext/spl/spl_fixedarray.c
-
5ext/spl/spl_heap.c
-
171ext/spl/spl_iterators.c
-
5ext/spl/spl_iterators.h
-
31ext/spl/tests/iterator_to_array_nonscalar_keys.phpt
-
20ext/spl/tests/multiple_iterator_001.phpt
-
74ext/standard/array.c
-
21ext/standard/tests/bug64370_var1.phpt
-
23ext/standard/tests/bug64370_var2.phpt
-
2win32/globals.c
-
4win32/php_win32_globals.h
-
133win32/time.c
@ -0,0 +1,52 @@ |
|||
--TEST-- |
|||
Generators can return non-scalar keys |
|||
--FILE-- |
|||
<?php |
|||
|
|||
function gen() { |
|||
yield [1, 2, 3] => [4, 5, 6]; |
|||
yield (object) ['a' => 'b'] => (object) ['b' => 'a']; |
|||
yield 3.14 => 2.73; |
|||
yield false => true; |
|||
yield true => false; |
|||
yield null => null; |
|||
} |
|||
|
|||
foreach (gen() as $k => $v) { |
|||
var_dump($k, $v); |
|||
} |
|||
|
|||
?> |
|||
--EXPECT-- |
|||
array(3) { |
|||
[0]=> |
|||
int(1) |
|||
[1]=> |
|||
int(2) |
|||
[2]=> |
|||
int(3) |
|||
} |
|||
array(3) { |
|||
[0]=> |
|||
int(4) |
|||
[1]=> |
|||
int(5) |
|||
[2]=> |
|||
int(6) |
|||
} |
|||
object(stdClass)#3 (1) { |
|||
["a"]=> |
|||
string(1) "b" |
|||
} |
|||
object(stdClass)#4 (1) { |
|||
["b"]=> |
|||
string(1) "a" |
|||
} |
|||
float(3.14) |
|||
float(2.73) |
|||
bool(false) |
|||
bool(true) |
|||
bool(true) |
|||
bool(false) |
|||
NULL |
|||
NULL |
|||
1209
ext/date/lib/timezonedb.h
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,31 @@ |
|||
--TEST-- |
|||
Tests iterator_to_array() with non-scalar keys |
|||
--FILE-- |
|||
<?php |
|||
|
|||
function gen() { |
|||
yield "foo" => 0; |
|||
yield 1 => 1; |
|||
yield 2.5 => 2; |
|||
yield null => 3; |
|||
yield [] => 4; |
|||
yield new stdClass => 5; |
|||
} |
|||
|
|||
var_dump(iterator_to_array(gen())); |
|||
|
|||
?> |
|||
--EXPECTF-- |
|||
Warning: Illegal offset type in %s on line %d |
|||
|
|||
Warning: Illegal offset type in %s on line %d |
|||
array(4) { |
|||
["foo"]=> |
|||
int(0) |
|||
[1]=> |
|||
int(1) |
|||
[0]=> |
|||
int(2) |
|||
[""]=> |
|||
int(3) |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
--TEST-- |
|||
Test bug #64370 microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT'] |
|||
--FILE-- |
|||
<?php |
|||
echo "\$_SERVER['REQUEST_TIME']: {$_SERVER['REQUEST_TIME']}\n"; |
|||
echo "\$_SERVER['REQUEST_TIME_FLOAT']: {$_SERVER['REQUEST_TIME_FLOAT']}\n"; |
|||
echo "time(): " . time() . "\n"; |
|||
echo "microtime(true): " . microtime(true) . "\n"; |
|||
$d = (microtime(true)-$_SERVER['REQUEST_TIME_FLOAT'])*1000; |
|||
echo "created in $d ms\n"; |
|||
echo ((bool)($d >= 0)) . "\n"; |
|||
?> |
|||
===DONE=== |
|||
--EXPECTF-- |
|||
$_SERVER['REQUEST_TIME']: %d |
|||
$_SERVER['REQUEST_TIME_FLOAT']: %f |
|||
time(): %d |
|||
microtime(true): %f |
|||
created in %f ms |
|||
1 |
|||
===DONE=== |
|||
@ -0,0 +1,23 @@ |
|||
--TEST-- |
|||
Test bug #64370 sequential microtime(true) calls |
|||
--FILE-- |
|||
<?php |
|||
|
|||
$i = 0; |
|||
while(100000 > $i++) { |
|||
$m0 = microtime(true); |
|||
$m1 = microtime(true); |
|||
$d = $m1 - $m0; |
|||
|
|||
/*echo "$d\n";*/ |
|||
|
|||
if ($d < 0) { |
|||
die("failed in {$i}th iteration"); |
|||
} |
|||
} |
|||
echo "ok\n"; |
|||
?> |
|||
===DONE=== |
|||
--EXPECT-- |
|||
ok |
|||
===DONE=== |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue