Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,21 @@ PHP NEWS
. Fixed bug GH-23106 (mb_strpos() reads past the end of a haystack ending in
a truncated UTF-8 sequence). (Lazizbek Ergashev)

- PDO:
. Fixed PDOStatement::getColumnMeta() reading out of bounds for an invalid
column index. (Ilia Alshanetsky)

- PGSQL:
. Fixed pg_lo_write() rejecting data containing null bytes. (Ilia Alshanetsky)

- SPL:
. Fixed bug GH-23385 (SplDoublyLinkedList::serialize() use-after-free when
__serialize() removes an element). (David Carlier)

- SQLite:
. Fixed a crash when SQLite3::close() is called from a userland callback.
(Ilia Alshanetsky)

- Standard:
. Fixed bug #60110 (fclose(), file_put_contents(), copy() do not return false
properly). (Jakub Zelenka, Ilija Tovilo)
Expand Down
18 changes: 18 additions & 0 deletions Zend/Zend.m4
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,24 @@ AS_VAR_IF([php_cv_have_global_register_vars], [yes],
])
AC_MSG_CHECKING([whether to enable global register variables support])
AC_MSG_RESULT([$ZEND_GCC_GLOBAL_REGS])

dnl GCC doesn't propagate -ffixed-* from LTO objects. Reserve the VM registers
dnl before LTO code gen to avoid "global register variable follows a function definition"
AS_VAR_IF([ZEND_GCC_GLOBAL_REGS], [yes], [
zend_lto=no
for zend_flag in $CC $CFLAGS $LDFLAGS; do
AS_CASE([$zend_flag], [-flto|-flto=*], [zend_lto=yes], [-fno-lto], [zend_lto=no])
done
AS_VAR_IF([zend_lto], [yes], [
AS_CASE([$host_cpu],
[x86_64*|amd64*], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-r14 -ffixed-r15"])],
[x86*|amd*|i?86*|pentium], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-esi -ffixed-edi"])],
[aarch64*|arm64*], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-x27 -ffixed-x28"])],
[ppc64*|powerpc64*], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-r14 -ffixed-r15"])],
[riscv64*], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-x18 -ffixed-x19"])],
[AC_MSG_ERROR([Cannot reserve VM registers for LTO, disable LTO or use --disable-gcc-global-regs])])
])
])
])

dnl
Expand Down
14 changes: 7 additions & 7 deletions Zend/tests/asymmetric_visibility/variation.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Test {
echo 'done';
}

public function is() {
public function is_set() {
echo (int) isset($this->prop);
}

Expand Down Expand Up @@ -65,7 +65,7 @@ function im($test) {
echo 'done';
}

function is($test) {
function is_set($test) {
echo (int) isset($test->prop);
}

Expand All @@ -81,7 +81,7 @@ function us_dim($test) {

foreach ([true, false] as $init) {
foreach ([true, false] as $scope) {
foreach (['r', 'w', 'rw', 'im', 'is', 'us', 'us_dim'] as $op) {
foreach (['r', 'w', 'rw', 'im', 'is_set', 'us', 'us_dim'] as $op) {
$test = new Test();
if ($init) {
$test->init();
Expand All @@ -108,27 +108,27 @@ Init: 1, scope: 1, op: r: 1
Init: 1, scope: 1, op: w: done
Init: 1, scope: 1, op: rw: done
Init: 1, scope: 1, op: im: done
Init: 1, scope: 1, op: is: 1
Init: 1, scope: 1, op: is_set: 1
Init: 1, scope: 1, op: us: done
Init: 1, scope: 1, op: us_dim: done
Init: 1, scope: 0, op: r: 1
Init: 1, scope: 0, op: w: Cannot modify private(set) property Test::$prop from global scope
Init: 1, scope: 0, op: rw: Cannot modify private(set) property Test::$prop from global scope
Init: 1, scope: 0, op: im: Cannot indirectly modify private(set) property Test::$array from global scope
Init: 1, scope: 0, op: is: 1
Init: 1, scope: 0, op: is_set: 1
Init: 1, scope: 0, op: us: Cannot unset private(set) property Test::$prop from global scope
Init: 1, scope: 0, op: us_dim: Cannot indirectly modify private(set) property Test::$array from global scope
Init: 0, scope: 1, op: r: Typed property Test::$prop must not be accessed before initialization
Init: 0, scope: 1, op: w: done
Init: 0, scope: 1, op: rw: Typed property Test::$prop must not be accessed before initialization
Init: 0, scope: 1, op: im: done
Init: 0, scope: 1, op: is: 0
Init: 0, scope: 1, op: is_set: 0
Init: 0, scope: 1, op: us: done
Init: 0, scope: 1, op: us_dim: done
Init: 0, scope: 0, op: r: Typed property Test::$prop must not be accessed before initialization
Init: 0, scope: 0, op: w: Cannot modify private(set) property Test::$prop from global scope
Init: 0, scope: 0, op: rw: Typed property Test::$prop must not be accessed before initialization
Init: 0, scope: 0, op: im: Cannot indirectly modify private(set) property Test::$array from global scope
Init: 0, scope: 0, op: is: 0
Init: 0, scope: 0, op: is_set: 0
Init: 0, scope: 0, op: us: Cannot unset private(set) property Test::$prop from global scope
Init: 0, scope: 0, op: us_dim: done
8 changes: 4 additions & 4 deletions Zend/tests/asymmetric_visibility/variation_nested.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function im($test) {
echo 'done';
}

function is($test) {
function is_set($test) {
echo (int) isset($test->prop->prop);
}

Expand All @@ -50,7 +50,7 @@ function us_dim($test) {
}

foreach ([true, false] as $init) {
foreach (['r', 'w', 'rw', 'im', 'is', 'us', 'us_dim'] as $op) {
foreach (['r', 'w', 'rw', 'im', 'is_set', 'us', 'us_dim'] as $op) {
$test = new Test();
if ($init) {
$test->init();
Expand All @@ -72,13 +72,13 @@ Init: 1, op: r: 1
Init: 1, op: w: done
Init: 1, op: rw: done
Init: 1, op: im: done
Init: 1, op: is: 1
Init: 1, op: is_set: 1
Init: 1, op: us: done
Init: 1, op: us_dim: done
Init: 0, op: r: Typed property Test::$prop must not be accessed before initialization
Init: 0, op: w: Cannot indirectly modify private(set) property Test::$prop from global scope
Init: 0, op: rw: Typed property Test::$prop must not be accessed before initialization
Init: 0, op: im: Cannot indirectly modify private(set) property Test::$prop from global scope
Init: 0, op: is: 0
Init: 0, op: is_set: 0
Init: 0, op: us: done
Init: 0, op: us_dim: done
14 changes: 14 additions & 0 deletions Zend/tests/deprecated_identifiers/is/class_alias.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Using "is" as a class name alias is deprecated
--FILE--
<?php

class_alias('stdClass', 'is');

class_alias('stdClass', 'Foo\\is');

?>
--EXPECTF--
Deprecated: Using "is" as a class alias is deprecated since 8.6 in %s on line %d

Deprecated: Using "is" as a class alias is deprecated since 8.6 in %s on line %d
18 changes: 18 additions & 0 deletions Zend/tests/deprecated_identifiers/is/class_as_name.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Using "is" as a class name is deprecated
--FILE--
<?php

namespace Foo\Bar {
class is {}
}

namespace {
class is {}
}

?>
--EXPECTF--
Deprecated: Using "is" as a class name is deprecated since 8.6 in %s on line %d

Deprecated: Using "is" as a class name is deprecated since 8.6 in %s on line %d
18 changes: 18 additions & 0 deletions Zend/tests/deprecated_identifiers/is/class_as_name_use.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Using "is" as a class name in use statements is deprecated
--FILE--
<?php

namespace Foo\Bar {
use stdClass as is;
}

namespace {
use stdClass as is;
}

?>
--EXPECTF--
Deprecated: Using "is" as a class name is deprecated in %s on line %d

Deprecated: Using "is" as a class name is deprecated in %s on line %d
28 changes: 28 additions & 0 deletions Zend/tests/deprecated_identifiers/is/constant_as_name.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--TEST--
Using "is" as a constant name is deprecated
--FILE--
<?php

namespace Foo\Bar {
const is = 5;
}

namespace {
const is = 5;

define('is', 'x');

define('foo\\is', 'x');
}

?>
--EXPECTF--
Deprecated: Calling a constant "is" is deprecated since 8.6 in %s on line %d

Deprecated: Calling a constant "is" is deprecated since 8.6 in %s on line %d

Deprecated: Calling a constant "is" is deprecated since 8.6 in %s on line %d

Warning: Constant is already defined, this will be an error in PHP 9 in %s on line %d

Deprecated: Calling a constant "is" is deprecated since 8.6 in %s on line %d
18 changes: 18 additions & 0 deletions Zend/tests/deprecated_identifiers/is/constant_as_name_use.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Using "is" as a constant in use statements is deprecated
--FILE--
<?php

namespace Foo\Bar {
use const PHP_INT_MAX as is;
}

namespace {
use const PHP_INT_MAX as is;
}

?>
--EXPECTF--
Deprecated: Using "is" as a constant name is deprecated since 8.6 in %s on line %d

Deprecated: Using "is" as a constant name is deprecated since 8.6 in %s on line %d
18 changes: 18 additions & 0 deletions Zend/tests/deprecated_identifiers/is/function_as_name.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Using "is" as a function name is deprecated
--FILE--
<?php

namespace Foo\Bar {
function is() {}
}

namespace {
function is() {}
}

?>
--EXPECTF--
Deprecated: Calling a function "is" is deprecated since 8.6 in %s on line %d

Deprecated: Calling a function "is" is deprecated since 8.6 in %s on line %d
18 changes: 18 additions & 0 deletions Zend/tests/deprecated_identifiers/is/function_as_name_use.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Using "is" as a function in use statements is deprecated
--FILE--
<?php

namespace Foo\Bar {
use function strlen as is;
}

namespace {
use function strlen as is;
}

?>
--EXPECTF--
Deprecated: Using "is" as a function name is deprecated since 8.6 in %s on line %d

Deprecated: Using "is" as a function name is deprecated since 8.6 in %s on line %d
14 changes: 14 additions & 0 deletions Zend/tests/deprecated_identifiers/let/class_alias.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Using "let" as a class name alias is deprecated
--FILE--
<?php

class_alias('stdClass', 'let');

class_alias('stdClass', 'Foo\\let');

?>
--EXPECTF--
Deprecated: Using "let" as a class alias is deprecated since 8.6 in %s on line %d

Deprecated: Using "let" as a class alias is deprecated since 8.6 in %s on line %d
18 changes: 18 additions & 0 deletions Zend/tests/deprecated_identifiers/let/class_as_name.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Using "let" as a class name is deprecated
--FILE--
<?php

namespace Foo\Bar {
class let {}
}

namespace {
class let {}
}

?>
--EXPECTF--
Deprecated: Using "let" as a class name is deprecated since 8.6 in %s on line %d

Deprecated: Using "let" as a class name is deprecated since 8.6 in %s on line %d
18 changes: 18 additions & 0 deletions Zend/tests/deprecated_identifiers/let/class_as_name_use.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Using "let" as a class name in use statements is deprecated
--FILE--
<?php

namespace Foo\Bar {
use stdClass as let;
}

namespace {
use stdClass as let;
}

?>
--EXPECTF--
Deprecated: Using "let" as a class name is deprecated in %s on line %d

Deprecated: Using "let" as a class name is deprecated in %s on line %d
28 changes: 28 additions & 0 deletions Zend/tests/deprecated_identifiers/let/constant_as_name.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--TEST--
Using "let" as a constant name is deprecated
--FILE--
<?php

namespace Foo\Bar {
const let = 5;
}

namespace {
const let = 5;

define('let', 'x');

define('foo\\let', 'x');
}

?>
--EXPECTF--
Deprecated: Calling a constant "let" is deprecated since 8.6 in %s on line %d

Deprecated: Calling a constant "let" is deprecated since 8.6 in %s on line %d

Deprecated: Calling a constant "let" is deprecated since 8.6 in %s on line %d

Warning: Constant let already defined, this will be an error in PHP 9 in %s on line %d

Deprecated: Calling a constant "let" is deprecated since 8.6 in %s on line %d
18 changes: 18 additions & 0 deletions Zend/tests/deprecated_identifiers/let/constant_as_name_use.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Using "let" as a constant in use statements is deprecated
--FILE--
<?php

namespace Foo\Bar {
use const PHP_INT_MAX as let;
}

namespace {
use const PHP_INT_MAX as let;
}

?>
--EXPECTF--
Deprecated: Using "let" as a constant name is deprecated since 8.6 in %s on line %d

Deprecated: Using "let" as a constant name is deprecated since 8.6 in %s on line %d
18 changes: 18 additions & 0 deletions Zend/tests/deprecated_identifiers/let/function_as_name.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Using "let" as a function name is deprecated
--FILE--
<?php

namespace Foo\Bar {
function let() {}
}

namespace {
function let() {}
}

?>
--EXPECTF--
Deprecated: Calling a function "let" is deprecated since 8.6 in %s on line %d

Deprecated: Calling a function "let" is deprecated since 8.6 in %s on line %d
Loading