Skip to content

Commit eaf0973

Browse files
committed
Merge branch 'master' into jit-dynasm
* master: (33 commits) Test for function posix_getpwnam() basic functionality NEWS Removed pdo_odbc.db2_instance_name Fix file permissions Remove PHP_DECLARED_TIMEZONE and HAVE_DECLARED_TIMEZONE Free map_base_ptr during post_startup Don't remove CONST CAST in CONCAT operand Remove unnecessary convert_to_string_safe macro Fix leak in resolve_property_types Don't return inside _DO_THROW macro Remove more leftovers of mysqli embedded server Fixed bug #50020 (DateInterval:createDateFromString() silently fails) Sync with 7be0e06 Remove dead code Remove mysqli embedded server support Sync with behavior change in OpenSSL 1.1.1b Use zpp string argument in imagecreatefromstring() Disable test parallelization on AppVeyor with opcache Mark ext/xmlreader/tests/bug70309.phpt as online test Fixed bug #77669 ...
2 parents 65215c3 + 615ec39 commit eaf0973

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+440
-722
lines changed

.appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ environment:
3030
matrix:
3131
- THREAD_SAFE: 0
3232
OPCACHE: 0
33+
PARALLEL: -j2
3334
- THREAD_SAFE: 1
3435
OPCACHE: 1
36+
PARALLEL:
3537
INTRINSICS: AVX
3638

3739
services:

.gdbinit

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ define ____printzv_contents
165165
set $type = $zvalue->u1.v.type
166166

167167
# 15 == IS_INDIRECT
168-
if $type > 5 && $type != 15
168+
if $type > 5 && $type < 12
169169
printf "(refcount=%d) ", $zvalue->value.counted->gc.refcount
170170
end
171171

@@ -215,12 +215,8 @@ define ____printzv_contents
215215
if ! $arg1
216216
if $handlers->get_properties == &zend_std_get_properties
217217
if $zobj->properties
218+
printf "\nProperties "
218219
set $ht = $zobj->properties
219-
else
220-
set $ht = &$zobj->ce->properties_info
221-
end
222-
printf "\nProperties "
223-
if $ht
224220
set $ind = $ind + 1
225221
____print_ht $ht 1
226222
set $ind = $ind - 1
@@ -230,7 +226,19 @@ define ____printzv_contents
230226
set $i = $i - 1
231227
end
232228
else
233-
echo "not found"
229+
printf " {\n"
230+
set $ht = &$zobj->ce->properties_info
231+
set $k = 0
232+
set $num = $ht->nNumUsed
233+
while $k < $num
234+
set $p = (Bucket*)($ht->arData + $k)
235+
set $name = $p->key
236+
set $prop = (zend_property_info*)$p->val.value.ptr
237+
set $val = (zval*)((char*)$zobj + $prop->offset)
238+
printf "%s => ", $name->val
239+
printzv $val
240+
set $k = $k + 1
241+
end
234242
end
235243
end
236244
end
@@ -250,17 +258,20 @@ define ____printzv_contents
250258
printf "CONSTANT_AST"
251259
end
252260
if $type == 13
253-
printf "_BOOL"
261+
printf "indirect: "
262+
____printzv $zvalue->value.zv $arg1
254263
end
255264
if $type == 14
256-
printf "CALLABLE"
265+
printf "pointer: %p", $zvalue->value.ptr
257266
end
258267
if $type == 15
259-
printf "indirect: "
260-
____printzv $zvalue->value.zv $arg1
268+
printf "_ERROR"
269+
end
270+
if $type == 16
271+
printf "_BOOL"
261272
end
262273
if $type == 17
263-
printf "pointer: %p", $zvalue->value.ptr
274+
printf "CALLABLE"
264275
end
265276
if $type == 18
266277
printf "ITERABLE"
@@ -269,9 +280,9 @@ define ____printzv_contents
269280
printf "VOID"
270281
end
271282
if $type == 20
272-
printf "_ERROR"
283+
printf "_NUMBER"
273284
end
274-
if $type == 16 || $type > 20
285+
if $type > 20
275286
printf "unknown type %d", $type
276287
end
277288
printf "\n"

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ PHP NEWS
33
?? ??? ????, PHP 8.0.0alpha1
44

55
- Core:
6+
. Removed the pdo_odbc.db2_instance_name php.ini directive. (Kalle)
67
. Fixed bug #77619 (Wrong reflection on MultipleIterator::__construct).
78
(Fabien Villepinte)
89

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ PHP 8.0 UPGRADE NOTES
140140

141141
PDOStatement::setFetchMode($mode, $classname, $params)
142142

143+
- PDO_ODBC:
144+
. The php.ini directive pdo_odbc.db2_instance_name has been removed
145+
143146
- Reflection:
144147
. The method signatures
145148

Zend/Zend.m4

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp)
8383
8484
AC_CHECK_DECLS([isfinite, isnan, isinf], [], [], [[#include <math.h>]])
8585
86-
ZEND_FP_EXCEPT
87-
8886
ZEND_CHECK_FLOAT_PRECISION
8987
9088
dnl test whether double cast to long preserves least significant bits

Zend/acinclude.m4

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,6 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
4242
esac
4343
])
4444

45-
AC_DEFUN([ZEND_FP_EXCEPT],[
46-
AC_CACHE_CHECK(whether fp_except is defined, ac_cv_type_fp_except,[
47-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
48-
#include <floatingpoint.h>
49-
]],[[
50-
fp_except x = (fp_except) 0;
51-
]])],[
52-
ac_cv_type_fp_except=yes
53-
],[
54-
ac_cv_type_fp_except=no
55-
])])
56-
if test "$ac_cv_type_fp_except" = "yes"; then
57-
AC_DEFINE(HAVE_FP_EXCEPT, 1, [whether floatingpoint.h defines fp_except])
58-
fi
59-
])
60-
6145
dnl x87 floating point internal precision control checks
6246
dnl See: http://wiki.php.net/rfc/rounding
6347
AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[

Zend/tests/bug69788.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ Bug #69788: Malformed script causes Uncaught Error in php-cgi, valgrind SIGILL
33
--FILE--
44
<?php [t.[]]; ?>
55
--EXPECTF--
6-
Notice: Array to string conversion in %s on line %d
7-
86
Fatal error: Uncaught Error: Undefined constant 't' in %s:%d
97
Stack trace:
108
#0 {main}
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
--TEST--
2+
Test binary operands exposing the same behavior at compile as at run time
3+
--INI--
4+
memory_limit=256M
5+
--FILE--
6+
<?php
7+
8+
$operands = [
9+
"==",
10+
"!=",
11+
"===",
12+
"!==",
13+
"<",
14+
"<=",
15+
">",
16+
">=",
17+
"<=>",
18+
"+",
19+
"-",
20+
"*",
21+
"/",
22+
"%",
23+
"**",
24+
".",
25+
"|",
26+
"&",
27+
"^",
28+
"or",
29+
"and",
30+
"xor",
31+
"||",
32+
"&&",
33+
];
34+
35+
$input = [
36+
0,
37+
1,
38+
2,
39+
-1,
40+
2.0,
41+
2.1,
42+
-2.0,
43+
-2.1,
44+
PHP_INT_MAX,
45+
PHP_INT_MIN,
46+
PHP_INT_MAX * 2,
47+
PHP_INT_MIN * 2,
48+
INF,
49+
NAN,
50+
[],
51+
[1, 2],
52+
[1, 2, 3],
53+
[1 => 2, 0 => 1],
54+
[1, 'a' => 2],
55+
[1, 4],
56+
[1, 'a'],
57+
[1, 2 => 2],
58+
[1, [ 2 ]],
59+
null,
60+
false,
61+
true,
62+
"",
63+
" ",
64+
"banana",
65+
"Banana",
66+
"banan",
67+
"0",
68+
"200",
69+
"20",
70+
"20a",
71+
" \t\n\r\v\f20",
72+
"20 ",
73+
"2e1",
74+
"2e150",
75+
"9179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368",
76+
"-9179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368",
77+
"0.1",
78+
"-0.1",
79+
"1e-1",
80+
"-20",
81+
"-20.0",
82+
"0x14",
83+
(string) PHP_INT_MAX * 2,
84+
(string) PHP_INT_MIN * 2,
85+
];
86+
87+
function makeParam($param) {
88+
if ($param === PHP_INT_MIN) {
89+
return "PHP_INT_MIN";
90+
}
91+
if ($param === PHP_INT_MAX) {
92+
return "PHP_INT_MAX";
93+
}
94+
if (is_string($param)) {
95+
return '"' . strtr($param, ["\t" => '\t', "\n" => '\n', "\r" => '\r', "\v" => '\v', "\f" => '\f', '$' => '\$', '"' => '\"']) . '"';
96+
}
97+
return "(" . str_replace("\n", "", var_export($param, true)) . ")";
98+
}
99+
100+
$c = 0;
101+
$f = 0;
102+
103+
function prepareLine($op1, $op2, $cmp, $operator) {
104+
105+
$op1_p = makeParam($op1);
106+
$op2_p = makeParam($op2);
107+
108+
$error = "echo '" . addcslashes("$op1_p $operator $op2_p", "\\'") . '\', "\n"; $f++;';
109+
110+
$compare = "@($op1_p $operator $op2_p)";
111+
$line = "\$c++; try { ";
112+
try {
113+
$result = makeParam($cmp());
114+
$line .= "if (" . ($result === "(NAN)" ? "!is_nan($compare)" : "$compare !== $result") . ") { $error } } catch (Error \$e) { $error }";
115+
} catch (Error $e) {
116+
if (get_class($e) == "Error") {
117+
return "// exempt $op1_p $operator $op2_p from checking, it generates a compile time error";
118+
}
119+
$msg = makeParam($e->getMessage());
120+
$line .= "$compare; $error } catch (Error \$e) { if (\$e->getMessage() !== $msg) { $error } }";
121+
}
122+
return $line;
123+
}
124+
125+
$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'compare_binary_operands_temp.php';
126+
$file = fopen($filename, "w");
127+
128+
fwrite($file, "<?php\n");
129+
130+
foreach ($input as $left) {
131+
foreach ($input as $right) {
132+
foreach ($operands as $operand) {
133+
fwrite($file, prepareLine($left, $right, function() use ($left, $right, $operand) { return eval("return @(\$left $operand \$right);"); }, $operand) . "\n");
134+
}
135+
}
136+
}
137+
138+
fclose($file);
139+
140+
include $filename;
141+
142+
if($c === 0) {
143+
echo "Completely failed\n";
144+
} else {
145+
echo "Failed: $f\n";
146+
}
147+
?>
148+
===DONE===
149+
--CLEAN--
150+
<?php
151+
$fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'compare_binary_operands_temp.php';
152+
@unlink($fl);
153+
?>
154+
--EXPECTF--
155+
Failed: 0
156+
===DONE===
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Bug #77673 ReflectionClass::getDefaultProperties returns spooky array
3+
--FILE--
4+
<?php
5+
class A {
6+
public B $c;
7+
}
8+
9+
$class = new ReflectionClass(A::class);
10+
11+
$defaults = $class->getDefaultProperties();
12+
13+
var_dump($defaults);
14+
var_dump(array_key_exists('c', $defaults));
15+
?>
16+
--EXPECT--
17+
array(0) {
18+
}
19+
bool(false)
20+

Zend/zend.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,11 +959,13 @@ static void zend_resolve_property_types(void) /* {{{ */
959959
if (UNEXPECTED(ce->type == ZEND_INTERNAL_CLASS && ZEND_CLASS_HAS_TYPE_HINTS(ce))) {
960960
ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop_info) {
961961
if (ZEND_TYPE_IS_NAME(prop_info->type)) {
962-
zend_string *type_name = zend_string_tolower(ZEND_TYPE_NAME(prop_info->type));
963-
zend_class_entry *prop_ce = zend_hash_find_ptr(CG(class_table), type_name);
962+
zend_string *type_name = ZEND_TYPE_NAME(prop_info->type);
963+
zend_string *lc_type_name = zend_string_tolower(type_name);
964+
zend_class_entry *prop_ce = zend_hash_find_ptr(CG(class_table), lc_type_name);
964965

965966
ZEND_ASSERT(prop_ce && prop_ce->type == ZEND_INTERNAL_CLASS);
966967
prop_info->type = ZEND_TYPE_ENCODE_CE(prop_ce, ZEND_TYPE_ALLOW_NULL(prop_info->type));
968+
zend_string_release(lc_type_name);
967969
zend_string_release(type_name);
968970
}
969971
} ZEND_HASH_FOREACH_END();
@@ -1009,6 +1011,8 @@ int zend_post_startup(void) /* {{{ */
10091011
compiler_globals->function_table = NULL;
10101012
free(compiler_globals->class_table);
10111013
compiler_globals->class_table = NULL;
1014+
free(compiler_globals->map_ptr_base);
1015+
compiler_globals->map_ptr_base = NULL;
10121016
if ((script_encoding_list = (zend_encoding **)compiler_globals->script_encoding_list)) {
10131017
compiler_globals_ctor(compiler_globals);
10141018
compiler_globals->script_encoding_list = (const zend_encoding **)script_encoding_list;

0 commit comments

Comments
 (0)