Commit Graph

137666 Commits

Author SHA1 Message Date
Peter Kokot
1a126c540a
Autotools: Normalize flags arguments (#15671)
This is a follow up of 7edb9a07d7 that
provides passing compilation options to PHP_NEW_EXTENSION,
PHP_ADD_SOURCES, PHP_ADD_SOURCES_X, and PHP_SELECT_SAPI as a
blank-or-newline-separated argument.
2024-09-01 01:02:40 +02:00
Christoph M. Becker
0f8259e896
ICU 75.1 requires C++17 (GH-15678)
This needs to be explicitly enabled for MSVC (and probably clang on
Windows); otherwise the default is C++14, which is no longer sufficient
for ICU[1].

While the official PHP 8.4 builds for Windows do not yet use ICU 75.1,
that may change[2].  And even if not, it would be nice for custom
builds to be able to build against ICU 75.1 (or later).

Anyhow, using `std:c++17` is fine for ICU 72.1 which we are currently
using (and likely for some older ICU versions).

[1] <https://github.com/unicode-org/icu/releases/tag/release-75-1>
[2] <https://github.com/winlibs/icu4c/pulls>
2024-08-31 17:01:49 +02:00
Christoph M. Becker
b3d6414b87
Drop support for building with MSC_VER < 1920
`MSC_VER` 1920 refers to Visual Studio 2019 RTW 16.0[1], and this
should be the bare minimum which we support nowadays.  If users use an
older Visual Studio version, we fail gracefully during `configure`.

[1] <https://learn.microsoft.com/en-us/cpp/overview/compiler-versions?view=msvc-170>

Closes GH-15403.
2024-08-31 17:00:21 +02:00
Ayesh Karunaratne
a8df3d1eed
ext/curl: libcurl CURLOPT_{FTP_RESPONSE_TIMEOUT,ENCODING} replacements (#15126) 2024-08-31 14:26:11 +01:00
Niels Dossche
82c504fa9c
Fix GH-15670: Polymorphic cache slot issue in DOM (#15676)
A cache slot can be hit with different DOM object types, so we should
check if we're still handling the same type.
2024-08-31 12:13:21 +02:00
Niels Dossche
73b7993b0d
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15654: Signed integer overflow in ext/dom/nodelist.c
2024-08-31 11:56:34 +02:00
Niels Dossche
9cb23a3dec
Fix GH-15654: Signed integer overflow in ext/dom/nodelist.c
There's implicit truncation casts from zend_long to int which cause
issues because checks are done against the zend_longs. Since the
iterator infrastructure uses zend_longs, just convert everything to
zend_long.

Closes GH-15669.
2024-08-31 11:47:08 +02:00
Saki Takamachi
166f343d59
[skip ci] NEWS for Fixed LONG_MAX in BCMath ext (#15663) 2024-08-31 18:23:36 +09:00
Saki Takamachi
44ec179b7e
NEWS for ext/bcmath: Fixed bcdiv() div by one (#15629) 2024-08-31 17:52:44 +09:00
Simonov Denis
eb3e7a2c0c
ext/pdo_firebird: Fixed GH-15604 Always make input parameters nullable (#15605)
Fixes #15604
Closes #15605
2024-08-31 17:06:41 +09:00
Go Kudo
b221f21b49 Merge branch 'PHP-8.3' 2024-08-31 15:58:13 +09:00
Go Kudo
8ad7d8f1cd Merge branch 'PHP-8.2' into PHP-8.3 2024-08-31 15:57:26 +09:00
Go Kudo
bf9929a26c
standard: supress msan (#15665) 2024-08-31 15:56:11 +09:00
Peter Kokot
5ed1659039
Autotools: Fix pdo_mysql build with mysql client library (#15450)
When using --with-pdo-mysql=DIR and for some reason DIR wouldn't have
the executable DIR/bin/mysql_config available the 3rd option was so far
to guess the mysql client library locations and pass the include
directory further. The library directory and library name to link was
missing. This fixes this case for consistency reasons. And in the future
also the pkg-config could be a reliable alternative to mysql_config in
that case. The PDO_MYSQL_INC_DIR is already processed PHP_EVAL_INCLINE
so redundant PHP_ADD_INCLUDE is removed.
2024-08-31 02:35:34 +02:00
Peter Kokot
558ccf7362
Autotools: Add 3rd argument to dba PHP_TEMP_LDFLAGS
[skip ci]
2024-08-31 00:41:41 +02:00
Peter Kokot
b7db7708c3
Autotools: Refactor ODBC type checks (#15651)
- AS_VAR_IF macros used
- All check messages moved to the PHP_ARG_WITH 2nd argument and results
  simplified where possible (the ext_output variable and result message
  is done automatically when using PHP_ARG_* macros)
- Unusued ODBC_SHARED and ODBC_STATIC shell variables for DBMaker
  removed
- Help text for --with-unixodbc (and/or --with-unixODBC) configure
  option synced with current Autotools code. It is still possible to
  bypass the pkg-config search with optional DIR argument
2024-08-30 23:54:11 +02:00
Peter Kokot
75c797492b
Autotools: Replace backticks with $(...) in php.m4 (#15642)
This is a follow-up of GH-15639
2024-08-30 23:32:42 +02:00
David Carlier
fc01e2ee2b
Merge branch 'PHP-8.3' 2024-08-30 17:17:44 +01:00
David Carlier
d7d40b4c80
Merge branch 'PHP-8.2' into PHP-8.3 2024-08-30 17:17:20 +01:00
David Carlier
7db1a5843f
Fix GH-15653: fgetcsv overflow on length parameter.
close GH-15655
2024-08-30 17:16:57 +01:00
Saki Takamachi
a27878cff3
Fixed LONG_MAX in BCMath ext (#15663) 2024-08-31 01:07:33 +09:00
Arnaud Le Blanc
58aa6fc830
Lazy objects
RFC: https://wiki.php.net/rfc/lazy-objects

Closes GH-15019
2024-08-30 17:30:03 +02:00
Ilija Tovilo
e12188fe89
Fix asymmetric visibility with set hook
Fixes GH-15644
Closes GH-15645
2024-08-30 09:42:27 +02:00
Saki Takamachi
e8fe7e4f52
ext/bcmath: Fixed bcdiv() div by one (#15629)
Fixed the incorrect scale that should be used when dividing by 1, that is,
comparing the divisor and 1 to confirm equality.

Additionally, have increased the number of test cases for bcdiv_by_pow_10.phpt.
2024-08-30 09:33:17 +09:00
Peter Kokot
09d5b7102a
Fix -Wunused-function warning in ext/pdo_firebird (#15646)
When FB_API_VER equals to 30, for example, on Ubuntu, there is this
warning thrown with certain compiler configurations:

    /php-src/ext/pdo_firebird/pdo_firebird_utils.cpp:21:13: warning:
    ‘void fb_copy_status(const ISC_STATUS*, ISC_STATUS*, size_t)’
    defined but not used [-Wunused-function]
       21 | static void fb_copy_status(const ISC_STATUS* from, ISC_STATUS* to, size_t maxLength)
          |             ^~~~~~~~~~~~~~
2024-08-30 01:22:52 +02:00
Peter Kokot
7ebdd7d05a
Trim trailing whitespace (#15649)
[skip ci]
2024-08-30 01:20:56 +02:00
Peter Kokot
b3661701e1
Autotools: Sync CS in ext/dba (part 2) (#15621)
This is a follow-up of 4f6f4fb7d5

- PHP_DBA_DB_CHECK arguments quoted and normalized
- long lines reduced a bit
- Few additional AS_VAR_IF used
- Typo in variable name ${dbdp} fixed to ${dbdp4} as there is no dbdp
  variable anymore as of 4.x and 5.x paths checks
2024-08-30 00:59:44 +02:00
Peter Kokot
1b757c8d3c
Autotools: Replace backticks command substitutions with $(...) (#15639)
This is a follow-up of previous backticks replacement commits. This
replaces backticks command substitutions in remaining ext config M4
files, phpize, and configure.ac with the recommended $(...).

Note that $(...) still does not work on some obsolete shells that ship
with Solaris 10, for example. Elsewhere they should work. However, for
these obsolete shells Autoconf also re-executes the shell script under
the supported shell so it can make them work regardless.

Additionally, few comments CS are also adjusted to not cause confusion
when searching for backticks usages and one indentation sync done.

As of Autoconf 2.72 the backticks in macro help texts are also replaced
with single quotes.
2024-08-30 00:40:49 +02:00
David Carlier
307565d577
ext/gd: porting gdImageClone to the bundled libgd version.
close GH-15640
2024-08-29 23:13:20 +01:00
Dmitry Stogov
eb89233800
Merge branch 'PHP-8.3'
* PHP-8.3:
  Don't set IS_STR_PERMANENT flag for strings stored in the file cache (#15643)
2024-08-30 01:01:33 +03:00
Dmitry Stogov
b55816e9d1
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Don't set IS_STR_PERMANENT flag for strings stored in the file cache (#15643)
2024-08-30 01:01:22 +03:00
Dmitry Stogov
afba2010c0
Don't set IS_STR_PERMANENT flag for strings stored in the file cache (#15643) 2024-08-30 00:59:06 +03:00
Peter Kokot
0a6019a7d6
Autotools: Use SED variable for sed command (#15641)
This syncs sed usages across the build system as SED variable is set to
a suitable sed program on the system.
2024-08-29 23:46:04 +02:00
Dmitry Stogov
80efb3aba4
Merge branch 'PHP-8.3'
* PHP-8.3:
  Prevent possible incorrect optimization caused by ZEND_ASSUME()
2024-08-29 23:12:56 +03:00
Dmitry Stogov
bf98023f1a
Prevent possible incorrect optimization caused by ZEND_ASSUME() 2024-08-29 23:10:34 +03:00
Niels Dossche
367f303efa
Optimize DOM property access (#15626)
For the read and write implementation, store the handler pointer in the
first cache slot.
For the write implementation, use the second cache slot to store the
property info.

For a micro-benchmark that performs a write:
```php
$dom = new DOMDocument;
for ($i=0;$i<9999999;$i++)
        $dom->strictErrorChecking = false;
```

I obtain the following results on an i7-4790:

```
  ./sapi/cli/php ./write.php ran
    1.42 ± 0.08 times faster than ./sapi/cli/php_old ./write.php
```

For a micro-benchmark that performs a read:
```php
$dom = new DOMDocument;
for ($i=0;$i<9999999;$i++)
        $dom->strictErrorChecking;
```

I obtain the following results on the same machine:

```
  ./sapi/cli/php ./read.php ran
    1.29 ± 0.13 times faster than ./sapi/cli/php_old ./read.php
```
2024-08-29 20:13:29 +02:00
Dmitry Stogov
0268cb0343
Merge branch 'PHP-8.3'
* PHP-8.3:
  Restore error message incorrectly removed by commit 10d43c4 (related to GH-15497)
2024-08-29 17:00:43 +03:00
Dmitry Stogov
c15bb9afe2
Restore error message incorrectly removed by commit 10d43c4 (related to GH-15497) 2024-08-29 16:59:14 +03:00
Dmitry Stogov
45dac39c71
Prevent JIT of propery hooks in case of file caching (related to GH-15497) 2024-08-29 16:54:25 +03:00
Dmitry Stogov
fa7eb58c11
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15497: Opcache with file_cache and JIT enabled crashes (#15635)
2024-08-29 16:47:14 +03:00
Dmitry Stogov
17e313ee62
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15497: Opcache with file_cache and JIT enabled crashes (#15635)
2024-08-29 16:46:56 +03:00
Dmitry Stogov
fd42cdbd0a
Fix GH-15497: Opcache with file_cache and JIT enabled crashes (#15635) 2024-08-29 16:46:49 +03:00
Dmitry Stogov
d28b75f70d
Fix GH-15497: Opcache with file_cache and JIT enabled crashes (#15635) 2024-08-29 16:45:15 +03:00
Peter Kokot
7e1e450bb9
Autotools: Remove redundant double quotes (#15634) 2024-08-29 15:17:03 +02:00
Ilija Tovilo
daeb3295b2
Improve readonly avis error (GH-15618)
We don't track whether protected(set) is implicit, so for now always point out
when the property is readonly in the error message.
2024-08-29 13:19:31 +02:00
Peter Kokot
e016e3521a
Remove redundant HAVE_LIBREADLINE check (#15623)
The HAVE_LIBREADLINE is at this point only defined by Autotools and this
check is for Windows only where only HAVE_LIBEDIT is defined.
2024-08-29 12:49:34 +02:00
Peter Kokot
7edb9a07d7
Autotools: Normalize 2nd arg in PHP_ADD_SOURCES_X (#15088)
By using `m4_normalize(m4_expand([...]))`, the arguments can be split
into newlines without using backslashes and it makes working with lists
of files a bit easier.

Tested:
- variables inside the argument
- M4 macro expansions
- dnl comments
- any sequence of newlines, backslash-then-newline, multiple spaces,
  tabs...
- quoted/unquoted arguments

This now works for PHP_NEW_EXTENSION, PHP_ADD_SOURCES, PHP_ADD_SOURCES_X,
and PHP_SELECT_SAPI. The m4_normalize() usage is left in the php-src
config.m4 files following the 0a0d2d0631
for PECL extensions until phpize will be available on all supported
versions (minimum PHP 8.4).
2024-08-29 02:40:18 +02:00
Peter Kokot
8aaedbf96f
Autotools: Sync CS in ext/odbc (#15625)
- Obsolete backticks replaced with $(...); also backticks used inside
  AC_MSG_RESULT result in literal output. The $(...) works as intended
  and is executed in the shell with proper result message given
- A couple of AS_VAR_IF used
- Macro arguments quoted
- Added simplistic macro definitions headers as done with other php-src
  M4 headers for consistency of reading the code
2024-08-29 01:38:24 +02:00
Peter Kokot
fbacc0f936
Autotools: Normalize PHP_ADD_BUILD_DIR 1st argument (#15612)
The m4_normalize(m4_expand([$1])) expands the given argument if it
contains M4 macros, and then trims the items together into a space
separated string in an intuitive way.
2024-08-29 00:44:29 +02:00
Peter Kokot
0a0d2d0631
Autotools: Normalize PHP_INSTALL_HEADERS arguments (#15620)
The m4_normalize(m4_expand([...])) simplifies working with a list of
header files. The m4_normalize() is at this point still used in the
php-src config.m4 files because of copy/paste probability to community
extensions where the arguments still need to be done in the old style to
support phpize in PHP-8.3 and earlier. For example:

    PHP_INSTALL_HEADERS([ext/dom], m4_normalize([
      dom_ce.h
      namespace_compat.h
      xml_common.h
      xpath_callbacks.h
    ]))

When PHP 8.4 will be the minimum supported PHP version, the headers can
be installed without using m4_normalize() in PECL extensions. For
example:

    PHP_INSTALL_HEADERS([ext/dom], [
      dom_ce.h
      namespace_compat.h
      xml_common.h
      xpath_callbacks.h
    ])
2024-08-28 23:08:53 +02:00