Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: php/php-src
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: php-8.2.10
Choose a base ref
...
head repository: php/php-src
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: php-8.2.11RC1
Choose a head ref

Commits on Aug 15, 2023

  1. Copy the full SHA
    4467f33 View commit details

Commits on Aug 16, 2023

  1. 3
    Copy the full SHA
    c1103a9 View commit details
  2. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Fix implicit/explicit port in mysqlnd
    kamil-tekiela committed Aug 16, 2023
    Copy the full SHA
    06bda99 View commit details

Commits on Aug 17, 2023

  1. Fix segfault in format_default_value due to unexpected enum/object

    Evaluating constants at comptime can result in arrays that contain objects. This
    is problematic for printing the default value of constant ASTs containing
    objects, because we don't actually know what the constructor arguments were.
    Avoid this by not propagating array constants.
    
    Fixes GH-11937
    Closes GH-11947
    iluuu1994 committed Aug 17, 2023
    Copy the full SHA
    f78d1d0 View commit details
  2. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Fix segfault in format_default_value due to unexpected enum/object
    iluuu1994 committed Aug 17, 2023
    Copy the full SHA
    9437aa9 View commit details
  3. Remove redundant condition

    Never refactor code just before pushing
    iluuu1994 committed Aug 17, 2023
    Copy the full SHA
    dd01c74 View commit details
  4. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Remove redundant condition
    iluuu1994 committed Aug 17, 2023
    Copy the full SHA
    d016c49 View commit details
  5. Copy the full SHA
    ffd398b View commit details
  6. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Fix failing test on nightly
    kamil-tekiela committed Aug 17, 2023
    Copy the full SHA
    6d039d2 View commit details

Commits on Aug 19, 2023

  1. Remove mysqli.reconnect from php.ini files (#11836)

    The `mysqli.reconnect` ini directive was removed in PHP 8.2.0.
    jrfnl authored and saundefined committed Aug 19, 2023
    Copy the full SHA
    85661a3 View commit details
  2. ext/iconv: fix build for netbsd.

    NetBSD still adopts the old iconv signature for buffer inputs.
    The next release will too so we can assume it will remain that way for
    a while.
    
    Close GH-12001
    devnexen committed Aug 19, 2023
    Copy the full SHA
    fc8d5c7 View commit details
  3. Copy the full SHA
    f995c0d View commit details

Commits on Aug 20, 2023

  1. Fix memory leak when setting an invalid DOMDocument encoding

    Because the failure path did not release the string, there was a memory
    leak.
    As the only valid types for this function are IS_NULL and IS_STRING, we
    and IS_NULL is always rejected in practice, solve the issue by not using
    a function that increments the refcount in the first place.
    
    Closes GH-12002.
    nielsdos committed Aug 20, 2023
    Copy the full SHA
    20ac42e View commit details
  2. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Fix memory leak when setting an invalid DOMDocument encoding
    nielsdos committed Aug 20, 2023
    Copy the full SHA
    767697c View commit details

Commits on Aug 23, 2023

  1. Copy the full SHA
    ba07a0b View commit details
  2. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Move installation of oracle instant client in GHA
    iluuu1994 committed Aug 23, 2023
    Copy the full SHA
    a8e5285 View commit details

Commits on Aug 24, 2023

  1. Copy the full SHA
    b1ce1d1 View commit details
  2. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Fix param name in implode() error message
    kamil-tekiela committed Aug 24, 2023
    Copy the full SHA
    ec82927 View commit details

Commits on Aug 26, 2023

  1. Copy the full SHA
    bffc744 View commit details
  2. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Add missing EXTENSIONS section to DOM tests
    nielsdos committed Aug 26, 2023
    Copy the full SHA
    ab2cc6e View commit details

Commits on Aug 28, 2023

  1. Copy the full SHA
    e1396a3 View commit details
  2. Copy the full SHA
    038bbd2 View commit details
  3. Fix missing instantclient in CI

    We should only pass the --with-pdo-oci and --with-oci8 flags if instantclient is
    installed.
    
    Closes GH-12066
    iluuu1994 committed Aug 28, 2023
    Copy the full SHA
    f3bd027 View commit details
  4. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Fix missing instantclient in CI
    iluuu1994 committed Aug 28, 2023
    Copy the full SHA
    ca4d7bf View commit details
  5. Copy the full SHA
    c8f6ee8 View commit details
  6. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      [skip ci] Fix trailing data in unserialize in soap test
    iluuu1994 committed Aug 28, 2023
    Copy the full SHA
    c128dbd View commit details
  7. On riscv64 require libatomic if actually needed

    clang and newer gcc releases support byte-sized atomic accesses on
    riscv64 through inline builtins.  In both cases the hard dependency on
    libatomic added by GH-11321 isn't useful.
    
    Stop using AC_CHECK_LIB() which is too naive to notice that libatomic
    isn't needed.  Instead, PHP_CHECK_FUNC() will retry the check with -latomic
    if required.
    
    Closes GH-11790
    jcourreges authored and petk committed Aug 28, 2023
    Copy the full SHA
    bf3fb4e View commit details
  8. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      On riscv64 require libatomic if actually needed
    petk committed Aug 28, 2023
    Copy the full SHA
    a1043fe View commit details

Commits on Aug 29, 2023

  1. Make unrepeatable tests retriable

    This was an error in thinking on my side. The reason these tests are
    unrepeatable is because --repeat executes the same request in the same process,
    and does not run the CLEAN section in between runs. This is not the case when
    retrying tests.
    
    We could potentially make CLEAN tests repeatable by including the CLEAN section
    in the tested script. This does however not work for all tests (e.g. tests that
    set open_basedir).
    
    Closes GH-12072
    iluuu1994 committed Aug 29, 2023
    Copy the full SHA
    f2c16b7 View commit details
  2. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Make unrepeatable tests retriable
    iluuu1994 committed Aug 29, 2023
    Copy the full SHA
    d5f7ffb View commit details

Commits on Aug 30, 2023

  1. Fix GH-11972: RecursiveCallbackFilterIterator regression in 8.1.18

    When you do an assignment between two zvals (no, not zval*), you copy
    all fields. This includes the additional u2 data. So that means for
    example the Z_NEXT index gets copied, which in some cases can therefore
    cause a cycle in zend_hash lookups.
    Instead of doing an assignment, we should be doing a ZVAL_COPY (or
    ZVAL_COPY_VALUE for non-refcounting cases). This avoids copying u2.
    
    Closes GH-12086.
    nielsdos committed Aug 30, 2023
    Copy the full SHA
    ffd7018 View commit details
  2. Skip dl() tests on ASAN

    iluuu1994 committed Aug 30, 2023
    Copy the full SHA
    fb0f421 View commit details
  3. Copy the full SHA
    d229a48 View commit details
  4. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Skip dl() tests on ASAN
    iluuu1994 committed Aug 30, 2023
    Copy the full SHA
    10c8103 View commit details
  5. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Fix GH-11972: RecursiveCallbackFilterIterator regression in 8.1.18
    nielsdos committed Aug 30, 2023
    Copy the full SHA
    262a227 View commit details
  6. Fix GH-11972: RecursiveCallbackFilterIterator regression in 8.1.18

    When you do an assignment between two zvals (no, not zval*), you copy
    all fields. This includes the additional u2 data. So that means for
    example the Z_NEXT index gets copied, which in some cases can therefore
    cause a cycle in zend_hash lookups.
    Instead of doing an assignment, we should be doing a ZVAL_COPY (or
    ZVAL_COPY_VALUE for non-refcounting cases). This avoids copying u2.
    
    Closes GH-12086.
    nielsdos committed Aug 30, 2023
    Copy the full SHA
    1cdcbc0 View commit details
  7. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Fix GH-11972: RecursiveCallbackFilterIterator regression in 8.1.18
    nielsdos committed Aug 30, 2023
    Copy the full SHA
    f134b0e View commit details
  8. Copy the full SHA
    f4a6a6d View commit details
  9. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Increase run-tests.php timeout for asan
    iluuu1994 committed Aug 30, 2023
    Copy the full SHA
    936538d View commit details

Commits on Sep 1, 2023

  1. [skip ci] Fix borked xleak skip on <PHP-8.3

    xleak in skipif was only added in PHP 8.3.
    iluuu1994 committed Sep 1, 2023
    Copy the full SHA
    b21df69 View commit details
  2. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      [skip ci] Fix borked xleak skip on <PHP-8.3
    iluuu1994 committed Sep 1, 2023
    Copy the full SHA
    aff86d6 View commit details

Commits on Sep 2, 2023

  1. Fix memory leak with failed SQLPrepare

    Closes GH-12095
    
    Signed-off-by: George Peter Banyard <girgias@php.net>
    NattyNarwhal authored and Girgias committed Sep 2, 2023
    Copy the full SHA
    a022ec5 View commit details
  2. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Fix memory leak with failed SQLPrepare
    Girgias committed Sep 2, 2023
    Copy the full SHA
    30b550b View commit details

Commits on Sep 3, 2023

  1. Fixed bug GH-12020: intl_get_error_message() broken after MessageForm…

    …atter::formatMessage() fails
    
    Passing NULL as the pointer to intl_error* will use the global error stack.
    This is what we need to do instead of pushing it onto the temporary format object that is released.
    Girgias committed Sep 3, 2023
    Copy the full SHA
    a579fa8 View commit details
  2. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      Fixed bug GH-12020: intl_get_error_message() broken after MessageFormatter::formatMessage() fails
    Girgias committed Sep 3, 2023
    Copy the full SHA
    fa0953f View commit details

Commits on Sep 4, 2023

  1. Copy the full SHA
    8cca0e8 View commit details
  2. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      [skip ci] Skip github actions when editing other ci files
    iluuu1994 committed Sep 4, 2023
    Copy the full SHA
    fc4c806 View commit details
  3. Copy the full SHA
    e3df233 View commit details
  4. Merge branch 'PHP-8.1' into PHP-8.2

    * PHP-8.1:
      [skip ci] Backport GA paths-ignore changes
    iluuu1994 committed Sep 4, 2023
    Copy the full SHA
    b4dc85f View commit details
  5. Fix freeing of incompletely initialized closures

    Addref to relevant fields before allocating any memory. Also only set/remove the
    ZEND_ACC_HEAP_RT_CACHE flag after allocating memory.
    
    Fixes GH-12073
    Closes GH-12074
    iluuu1994 committed Sep 4, 2023
    Copy the full SHA
    af2110e View commit details
Showing with 1,296 additions and 117 deletions.
  1. +0 −12 .github/actions/apt-x64/action.yml
  2. +2 −2 .github/actions/configure-x64/action.yml
  3. +1 −1 .github/actions/install-linux-x32/action.yml
  4. +1 −3 .github/actions/install-linux/action.yml
  5. +17 −0 .github/actions/setup-oracle/action.yml
  6. +1 −1 .github/workflows/nightly.yml
  7. +15 −1 .github/workflows/push.yml
  8. +48 −1 NEWS
  9. +21 −2 Zend/Optimizer/optimize_func_calls.c
  10. +1 −0 Zend/tests/arginfo_zpp_mismatch.phpt
  11. +1 −0 Zend/tests/arginfo_zpp_mismatch_strict.phpt
  12. +28 −0 Zend/tests/gh12073.phpt
  13. +30 −0 Zend/tests/gh12102_1.phpt
  14. +43 −0 Zend/tests/gh12102_2.phpt
  15. +32 −0 Zend/tests/gh12102_3.phpt
  16. +51 −0 Zend/tests/zend_ini/gh11876.phpt
  17. +1 −1 Zend/zend.h
  18. +7 −7 Zend/zend_closures.c
  19. +43 −3 Zend/zend_compile.c
  20. +40 −0 Zend/zend_ini.c
  21. +1 −0 Zend/zend_interfaces.c
  22. +1 −0 Zend/zend_vm_def.h
  23. +1 −0 Zend/zend_vm_execute.h
  24. +2 −6 configure.ac
  25. +4 −0 ext/dl_test/tests/skip.inc
  26. +12 −7 ext/dom/document.c
  27. +2 −0 ext/dom/tests/bug80602.phpt
  28. +2 −0 ext/dom/tests/bug80602_2.phpt
  29. +2 −0 ext/dom/tests/bug80602_3.phpt
  30. +2 −0 ext/dom/tests/bug80602_4.phpt
  31. +2 −0 ext/dom/tests/gh11288.phpt
  32. +2 −0 ext/dom/tests/gh11289.phpt
  33. +2 −0 ext/dom/tests/gh11290.phpt
  34. +38 −0 ext/dom/tests/gh12002.phpt
  35. +2 −0 ext/dom/tests/gh9142.phpt
  36. +17 −9 ext/iconv/iconv.c
  37. +6 −7 ext/intl/msgformat/msgformat_format.c
  38. +6 −0 ext/intl/tests/gh11658.phpt
  39. +22 −0 ext/intl/tests/gh12020.phpt
  40. +29 −0 ext/mysqli/tests/gh8978.phpt
  41. +2 −0 ext/mysqlnd/mysqlnd_commands.c
  42. +9 −8 ext/mysqlnd/mysqlnd_connection.c
  43. +0 −1 ext/mysqlnd/mysqlnd_vio.c
  44. +10 −7 ext/odbc/php_odbc.c
  45. +0 −3 ext/odbc/tests/config.inc
  46. +65 −0 ext/odbc/tests/odbc_persistent_close.phpt
  47. +2 −0 ext/opcache/jit/zend_jit_trace.c
  48. +4 −0 ext/opcache/tests/bug68104.phpt
  49. +1 −0 ext/reflection/php_reflection.c
  50. +13 −0 ext/reflection/tests/gh11937_1.inc
  51. +30 −0 ext/reflection/tests/gh11937_1.phpt
  52. +4 −0 ext/reflection/tests/gh11937_2.inc
  53. +27 −0 ext/reflection/tests/gh11937_2.phpt
  54. +1 −1 ext/simplexml/simplexml.c
  55. +58 −0 ext/simplexml/tests/bug52751.phpt
  56. +1 −1 ext/soap/tests/bug71610.phpt
  57. +2 −3 ext/spl/spl_array.c
  58. +196 −0 ext/spl/tests/gh11972.phpt
  59. +37 −0 ext/sqlite3/sqlite3.c
  60. +31 −0 ext/sqlite3/tests/gh11878.phpt
  61. +1 −1 ext/standard/string.c
  62. +9 −2 ext/standard/tests/file/file.inc
  63. +1 −0 ext/standard/tests/general_functions/dl-check-enabled.phpt
  64. +1 −0 ext/standard/tests/general_functions/dl-cve-2007-4887.phpt
  65. +1 −0 ext/standard/tests/general_functions/dl-full-path-not-supported.phpt
  66. +4 −0 ext/standard/tests/general_functions/gh9589.phpt
  67. +3 −3 ext/standard/tests/strings/implode1.phpt
  68. +1 −1 ext/standard/tests/strings/join_error.phpt
  69. +4 −4 ext/standard/tests/strings/join_variation2.phpt
  70. +1 −1 ext/zend_test/config.m4
  71. +1 −1 ext/zend_test/config.w32
  72. +121 −0 ext/zend_test/iterators.c
  73. +21 −0 ext/zend_test/iterators.h
  74. +14 −0 ext/zend_test/iterators.stub.php
  75. +31 −0 ext/zend_test/iterators_arginfo.h
  76. +2 −0 ext/zend_test/test.c
  77. +40 −0 ext/zend_test/tests/iterators/double-rewind.phpt
  78. +4 −4 main/php_version.h
  79. +0 −3 php.ini-development
  80. +0 −3 php.ini-production
  81. +5 −7 run-tests.php
12 changes: 0 additions & 12 deletions .github/actions/apt-x64/action.yml
Original file line number Diff line number Diff line change
@@ -59,15 +59,3 @@ runs:
libjpeg-dev \
libpng-dev \
libfreetype6-dev
mkdir /opt/oracle
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip
unzip instantclient-basiclite-linuxx64.zip && rm instantclient-basiclite-linuxx64.zip
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip
unzip instantclient-sdk-linuxx64.zip && rm instantclient-sdk-linuxx64.zip
mv instantclient_*_* /opt/oracle/instantclient
# interferes with libldap2 headers
rm /opt/oracle/instantclient/sdk/include/ldap.h
# fix debug build warning: zend_signal: handler was replaced for signal (2) after startup
echo DISABLE_INTERRUPT=on > /opt/oracle/instantclient/network/admin/sqlnet.ora
sudo sh -c 'echo /opt/oracle/instantclient >/etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig'
4 changes: 2 additions & 2 deletions .github/actions/configure-x64/action.yml
Original file line number Diff line number Diff line change
@@ -74,8 +74,8 @@ runs:
--with-imap \
--with-imap-ssl \
--with-pdo-odbc=unixODBC,/usr \
--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient \
--with-oci8=shared,instantclient,/opt/oracle/instantclient \
$([ -d "/opt/oracle/instantclient" ] && echo '--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient') \
$([ -d "/opt/oracle/instantclient" ] && echo '--with-oci8=shared,instantclient,/opt/oracle/instantclient') \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--with-pdo-firebird \
2 changes: 1 addition & 1 deletion .github/actions/install-linux-x32/action.yml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ runs:
run: |
set -x
make install
mkdir /etc/php.d
mkdir -p /etc/php.d
chmod 777 /etc/php.d
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
4 changes: 1 addition & 3 deletions .github/actions/install-linux/action.yml
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@ runs:
run: |
set -x
sudo make install
sudo mkdir /etc/php.d
sudo mkdir -p /etc/php.d
sudo chmod 777 /etc/php.d
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
echo extension=oci8.so > /etc/php.d/oci8.ini
echo extension=pdo_oci.so > /etc/php.d/pdo_oci.ini
17 changes: 17 additions & 0 deletions .github/actions/setup-oracle/action.yml
Original file line number Diff line number Diff line change
@@ -11,3 +11,20 @@ runs:
--name oracle \
-h oracle \
-d gvenzl/oracle-xe:slim
mkdir /opt/oracle
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip
unzip instantclient-basiclite-linuxx64.zip && rm instantclient-basiclite-linuxx64.zip
wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip
unzip instantclient-sdk-linuxx64.zip && rm instantclient-sdk-linuxx64.zip
mv instantclient_*_* /opt/oracle/instantclient
# interferes with libldap2 headers
rm /opt/oracle/instantclient/sdk/include/ldap.h
# fix debug build warning: zend_signal: handler was replaced for signal (2) after startup
echo DISABLE_INTERRUPT=on > /opt/oracle/instantclient/network/admin/sqlnet.ora
sudo sh -c 'echo /opt/oracle/instantclient >/etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig'
sudo mkdir -p /etc/php.d
sudo chmod 777 /etc/php.d
echo extension=oci8.so > /etc/php.d/oci8.ini
echo extension=pdo_oci.so > /etc/php.d/pdo_oci.ini
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -564,7 +564,7 @@ jobs:
- name: make install
run: |
sudo make install
sudo mkdir /etc/php.d
sudo mkdir -p /etc/php.d
sudo chmod 777 /etc/php.d
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
16 changes: 15 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -6,16 +6,30 @@ on:
- NEWS
- UPGRADING
- UPGRADING.INTERNALS
- README.md
- '**/README.*'
- CONTRIBUTING.md
- CODING_STANDARDS.md
- .cirrus.yml
- .travis.yml
- travis/*
branches:
- PHP-7.4
- PHP-8.0
- PHP-8.1
- PHP-8.2
- master
pull_request:
paths-ignore:
- docs/*
- NEWS
- UPGRADING
- UPGRADING.INTERNALS
- '**/README.*'
- CONTRIBUTING.md
- CODING_STANDARDS.md
- .cirrus.yml
- .travis.yml
- travis/*
branches:
- '**'
concurrency:
49 changes: 48 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,53 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.2.10
28 Sep 2023, PHP 8.2.11

- Core:
. Fixed bug GH-11937 (Constant ASTs containing objects). (ilutov)
. Fixed bug GH-11790 (On riscv64 require libatomic if actually needed).
(Jeremie Courreges-Anglas)
. Fixed bug GH-11876: ini_parse_quantity() accepts invalid quantities.
(Girgias)
. Fixed bug GH-12073 (Segfault when freeing incompletely initialized
closures). (ilutov)
. Fixed bug GH-12060 (Internal iterator rewind handler is called twice).
(ju1ius)
. Fixed bug GH-12102 (Incorrect compile error when using array access on TMP
value in function call). (ilutov)

- DOM:
. Fix memory leak when setting an invalid DOMDocument encoding. (nielsdos)

- Iconv:
. Fixed build for NetBSD which still uses the old iconv signature.
(David Carlier)

- Intl:
. Fixed bug GH-12020 (intl_get_error_message() broken after
MessageFormatter::formatMessage() fails). (Girgias)

- MySQLnd:
. Fixed bug GH-10270 (Invalid error message when connection via SSL fails:
"trying to connect via (null)"). (Kamil Tekiela)

- ODBC:
. Fixed memory leak with failed SQLPrepare. (NattyNarwhal)
. Fixed persistent procedural ODBC connections not getting closed.
(NattyNarwhal)

- SimpleXML:
. Fixed bug #52751 (XPath processing-instruction() function is not
supported). (nielsdos)

- SPL:
. Fixed bug GH-11972 (RecursiveCallbackFilterIterator regression in 8.1.18).
(nielsdos)

- SQLite3:
. Fixed bug GH-11878 (SQLite3 callback functions cause a memory leak with
a callable array). (nielsdos, arnaud-lb)

31 Aug 2023, PHP 8.2.10

- CLI:
. Fixed bug GH-11716 (cli server crashes on SIGINT when compiled with
23 changes: 21 additions & 2 deletions Zend/Optimizer/optimize_func_calls.c
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@
typedef struct _optimizer_call_info {
zend_function *func;
zend_op *opline;
zend_op *last_check_func_arg_opline;
bool is_prototype;
bool try_inline;
uint32_t func_arg_num;
@@ -235,6 +236,14 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx)
if (call_stack[call - 1].func_arg_num != (uint32_t)-1
&& has_known_send_mode(&call_stack[call - 1], call_stack[call - 1].func_arg_num)) {
if (ARG_SHOULD_BE_SENT_BY_REF(call_stack[call - 1].func, call_stack[call - 1].func_arg_num)) {
/* There's no TMP specialization for FETCH_OBJ_W/FETCH_DIM_W. Avoid
* converting it and error at runtime in the FUNC_ARG variant. */
if ((opline->opcode == ZEND_FETCH_OBJ_FUNC_ARG || opline->opcode == ZEND_FETCH_DIM_FUNC_ARG)
&& (opline->op1_type == IS_TMP_VAR || call_stack[call - 1].last_check_func_arg_opline == NULL)) {
/* Don't remove the associated CHECK_FUNC_ARG opcode. */
call_stack[call - 1].last_check_func_arg_opline = NULL;
break;
}
if (opline->opcode != ZEND_FETCH_STATIC_PROP_FUNC_ARG) {
opline->opcode -= 9;
} else {
@@ -278,11 +287,21 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx)

if (has_known_send_mode(&call_stack[call - 1], opline->op2.num)) {
call_stack[call - 1].func_arg_num = opline->op2.num;
MAKE_NOP(opline);
call_stack[call - 1].last_check_func_arg_opline = opline;
}
break;
case ZEND_SEND_VAR_EX:
case ZEND_SEND_FUNC_ARG:
/* Don't transform SEND_FUNC_ARG if any FETCH opcodes weren't transformed. */
if (call_stack[call - 1].last_check_func_arg_opline == NULL) {
if (opline->op2_type == IS_CONST) {
call_stack[call - 1].try_inline = 0;
}
break;
}
MAKE_NOP(call_stack[call - 1].last_check_func_arg_opline);
call_stack[call - 1].last_check_func_arg_opline = NULL;
ZEND_FALLTHROUGH;
case ZEND_SEND_VAR_EX:
if (opline->op2_type == IS_CONST) {
call_stack[call - 1].try_inline = 0;
break;
1 change: 1 addition & 0 deletions Zend/tests/arginfo_zpp_mismatch.phpt
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
Test that there is no arginfo/zpp mismatch
--SKIPIF--
<?php
if (getenv('SKIP_ASAN')) die("skip Intermittently crashes lsan");
if (getenv('SKIP_MSAN')) die("skip msan misses interceptors for some functions");
?>
--FILE--
1 change: 1 addition & 0 deletions Zend/tests/arginfo_zpp_mismatch_strict.phpt
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
Test that there is no arginfo/zpp mismatch in strict mode
--SKIPIF--
<?php
if (getenv('SKIP_ASAN')) die("skip Intermittently crashes lsan");
if (getenv('SKIP_MSAN')) die("skip msan misses interceptors for some functions");
?>
--FILE--
28 changes: 28 additions & 0 deletions Zend/tests/gh12073.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--TEST--
GH-12073: Freeing of non-ZMM pointer of incompletely allocated closure
--SKIPIF--
<?php
if (getenv("USE_ZEND_ALLOC") === "0" && getenv("USE_TRACKED_ALLOC") !== "1") {
die("skip Zend MM disabled");
}
?>
--FILE--
<?php

function test() {
$k = 1;
return function () use ($k) {
foo();
};
}

ini_set('memory_limit', '2M');

$array = [];
for ($i = 0; $i < 10_000; $i++) {
$array[] = test();
}

?>
--EXPECTF--
Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
30 changes: 30 additions & 0 deletions Zend/tests/gh12102_1.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
--TEST--
GH-12102: Incorrect "Cannot use temporary expression in write context" error for BP_VAR_FUNC_ARG
--FILE--
<?php

function test() {
byVal(func_get_args()[0]);
try {
byRef(func_get_args()[0]);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
}

/* Intentionally declared after test() to avoid compile-time checking of ref args. */

function byVal($arg) {
var_dump($arg);
}

function byRef(&$arg) {
var_dump($arg);
}

test('y');

?>
--EXPECT--
string(1) "y"
Cannot use temporary expression in write context
43 changes: 43 additions & 0 deletions Zend/tests/gh12102_2.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
--TEST--
GH-12102: Incorrect "Cannot use temporary expression in write context" error for BP_VAR_FUNC_ARG
--FILE--
<?php

function test() {
global $ref;
byVal(getRef()[0]);
var_dump($ref);
byRef(getRef()[0]);
var_dump($ref);
}

/* Intentionally declared after test() to avoid compile-time checking of ref args. */

function &getRef() {
global $ref;
$ref = [];
return $ref;
}

function byVal($arg) {
$arg[] = 42;
}

function byRef(&$arg) {
$arg[] = 42;
}

test();

?>
--EXPECTF--
Warning: Undefined array key 0 in %s on line %d
array(0) {
}
array(1) {
[0]=>
array(1) {
[0]=>
int(42)
}
}
32 changes: 32 additions & 0 deletions Zend/tests/gh12102_3.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--TEST--
GH-12102: Incorrect "Cannot use temporary expression in write context" error for BP_VAR_FUNC_ARG
--FILE--
<?php

function test() {
byVal(C[0]);
try {
byRef(C[0]);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
}

/* Intentionally declared after test() to avoid compile-time checking of ref args. */

const C = ['foo'];

function byVal($arg) {
var_dump($arg);
}

function byRef(&$arg) {
var_dump($arg);
}

test('y');

?>
--EXPECT--
string(3) "foo"
Cannot use temporary expression in write context
Loading