]> granicus.if.org Git - php/log
php
4 years agoAdd ZVAL_OBJ_COPY macro
Nikita Popov [Wed, 17 Jun 2020 10:34:04 +0000 (12:34 +0200)]
Add ZVAL_OBJ_COPY macro

For the common ZVAL_OBJ + GC_ADDREF pattern.
This mirrors the existing ZVAL_STR_COPY API.

4 years agoConvert CURL resources to objects
Máté Kocsis [Wed, 17 Jun 2020 14:05:55 +0000 (16:05 +0200)]
Convert CURL resources to objects

Closes GH-5402

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
4 years agoUpdate CREDITS
Sara Golemon [Wed, 17 Jun 2020 13:03:52 +0000 (13:03 +0000)]
Update CREDITS

4 years agoImproved JIT for SEPARATE_ARRAY
Dmitry Stogov [Wed, 17 Jun 2020 11:45:25 +0000 (14:45 +0300)]
Improved JIT for SEPARATE_ARRAY

4 years agoTracing JIT support for PHP references in ASSIGN instruction
Dmitry Stogov [Wed, 17 Jun 2020 09:24:51 +0000 (12:24 +0300)]
Tracing JIT support for PHP references in ASSIGN instruction

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 17 Jun 2020 07:35:19 +0000 (09:35 +0200)]
Merge branch 'PHP-7.4'

4 years agoAdd mbregex skipif
Nikita Popov [Wed, 17 Jun 2020 07:35:02 +0000 (09:35 +0200)]
Add mbregex skipif

4 years agocleanup
Dmitry Stogov [Wed, 17 Jun 2020 07:32:53 +0000 (10:32 +0300)]
cleanup

4 years agoUse ZEND_UNREACHABLE() instead of ZEND_ASSERT(0)
Christoph M. Becker [Tue, 16 Jun 2020 14:29:05 +0000 (16:29 +0200)]
Use ZEND_UNREACHABLE() instead of ZEND_ASSERT(0)

Instead of marking unreachable code with `ZEND_ASSERT(0)`, we introduce
`ZEND_UNREACHABLE()`, so that MSVC which does not consider `assert(0)`
to mark unreachable code does no longer trigger C4715[1] warnings in
debug builds.  This may be useful for other compilers as well.

[1] <https://docs.microsoft.com/de-de/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4715?view=vs-2019>

4 years agoMerge exit points
Dmitry Stogov [Tue, 16 Jun 2020 16:20:08 +0000 (19:20 +0300)]
Merge exit points

4 years agoEliminate a dead check
Dmitry Stogov [Tue, 16 Jun 2020 16:05:35 +0000 (19:05 +0300)]
Eliminate a dead check

4 years agoTracing JIT support for PHP references in array related instructions
Dmitry Stogov [Tue, 16 Jun 2020 14:59:04 +0000 (17:59 +0300)]
Tracing JIT support for PHP references in array related instructions

4 years agoConvert resource to object in Sysvshm extension
Máté Kocsis [Tue, 16 Jun 2020 14:36:11 +0000 (16:36 +0200)]
Convert resource to object in Sysvshm extension

Closes GH-5499

4 years agoFR #79344: xmlwriter_write_attribute_ns: $prefix should be nullable
Christoph M. Becker [Tue, 16 Jun 2020 12:08:55 +0000 (14:08 +0200)]
FR #79344: xmlwriter_write_attribute_ns: $prefix should be nullable

The `$prefix` parameter of `xmlwriter_write_element_ns()` and
`xmlwriter_start_element_ns()` is nullable, what allows these functions
to be used instead of their non NS variants.  Consequently, we make the
`$prefix` parameter of `xmlwriter_write_attribute_ns()` and
`xmlwriter_start_attribute_ns()` nullable as well.

4 years agoRemove debug code from usleep()
Nikita Popov [Tue, 16 Jun 2020 12:51:58 +0000 (14:51 +0200)]
Remove debug code from usleep()

This was added to debug CI failures, but ultimately didn't help
understand the macos timing issues. Drop it now so it's not
forgotten...

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Tue, 16 Jun 2020 12:32:33 +0000 (14:32 +0200)]
Merge branch 'PHP-7.4'

4 years agoFix non-default syntax in mb_ereg_search()
Nikita Popov [Tue, 16 Jun 2020 12:31:29 +0000 (14:31 +0200)]
Fix non-default syntax in mb_ereg_search()

4 years agoUse "lea" to add/sub register with constant
Dmitry Stogov [Tue, 16 Jun 2020 11:04:05 +0000 (14:04 +0300)]
Use "lea" to add/sub register with constant

4 years agoImproved JIT for ZVAL_COPY_DEREF
Dmitry Stogov [Tue, 16 Jun 2020 10:24:28 +0000 (13:24 +0300)]
Improved JIT for ZVAL_COPY_DEREF

4 years agoOptimize parallel test runner startup
Nikita Popov [Tue, 16 Jun 2020 09:39:03 +0000 (11:39 +0200)]
Optimize parallel test runner startup

Don't connect to each worker individually: First spawn all processes
and then establish connections in any order.

This avoids a ~1s wait when running on many cores.

4 years agoImplements an openpty wrapper for solaris based systems
David Carlier [Mon, 15 Jun 2020 08:53:30 +0000 (09:53 +0100)]
Implements an openpty wrapper for solaris based systems

This is only used by proc_open pty support, and as such declared
directly there.

4 years agoFix JIT build on solaris/illumos
David Carlier [Sat, 13 Jun 2020 22:18:54 +0000 (23:18 +0100)]
Fix JIT build on solaris/illumos

thr_self to detect the proper thread identifier but all
related typedef'd types conflict with the vtune part.

4 years agoFix printf type
Nikita Popov [Tue, 16 Jun 2020 08:57:29 +0000 (10:57 +0200)]
Fix printf type

4 years agoMade sure zpp is always called and refactored some existing zpp calls.
Jens de Nies [Sat, 13 Jun 2020 15:35:19 +0000 (17:35 +0200)]
Made sure zpp is always called and refactored some existing zpp calls.

Closes GH-5714

4 years agoFixed some oci8 tests.
Jens de Nies [Sat, 13 Jun 2020 23:37:59 +0000 (01:37 +0200)]
Fixed some oci8 tests.

Closes GH-5716

4 years agoAdded JIT debug flag to dump the size of generated code (opcache.jit_debug=0x200)
Dmitry Stogov [Tue, 16 Jun 2020 08:27:34 +0000 (11:27 +0300)]
Added JIT debug flag to dump the size of generated code (opcache.jit_debug=0x200)

4 years agoFix typo
Fabien Villepinte [Mon, 15 Jun 2020 19:32:01 +0000 (21:32 +0200)]
Fix typo

4 years agoAdded note
Dmitry Stogov [Mon, 15 Jun 2020 14:21:32 +0000 (17:21 +0300)]
Added note

4 years agoFixed JIT
Dmitry Stogov [Mon, 15 Jun 2020 12:35:02 +0000 (15:35 +0300)]
Fixed JIT

4 years agoChange GC_COLLECTABLE flag into GC_NOT_COLLECTABLE to simplify GC_MAY_LEAK() check
Dmitry Stogov [Mon, 15 Jun 2020 11:26:22 +0000 (14:26 +0300)]
Change GC_COLLECTABLE flag into GC_NOT_COLLECTABLE to simplify GC_MAY_LEAK() check

4 years agoFETCH_FIM_R/IS JIT improvement
Dmitry Stogov [Mon, 15 Jun 2020 09:15:56 +0000 (12:15 +0300)]
FETCH_FIM_R/IS JIT improvement

4 years agoFix typo in file cache job
Nikita Popov [Mon, 15 Jun 2020 08:13:04 +0000 (10:13 +0200)]
Fix typo in file cache job

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Sat, 13 Jun 2020 16:33:17 +0000 (18:33 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Sat, 13 Jun 2020 16:32:01 +0000 (18:32 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes

4 years agoFix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes
Christoph M. Becker [Sat, 13 Jun 2020 12:09:28 +0000 (14:09 +0200)]
Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes

Even if the length of a maker note does not match our expectations
(either because the maker note is corrupted, or because our
expectations do not quite match reality), there is no need to let
parsing fail; we can still go on parsing the other meta information.

4 years agoFix ZPP of OCI_Lob::free
Máté Kocsis [Sat, 13 Jun 2020 08:53:49 +0000 (10:53 +0200)]
Fix ZPP of OCI_Lob::free

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 12 Jun 2020 13:41:20 +0000 (15:41 +0200)]
Merge branch 'PHP-7.4'

4 years agoDrop freetype from i386
Nikita Popov [Fri, 12 Jun 2020 13:12:15 +0000 (15:12 +0200)]
Drop freetype from i386

For some reason this seems to pick up the amd64 library (though
we do install the i386 one).

4 years agoUse shared setup.yml on azure
Nikita Popov [Fri, 12 Jun 2020 13:09:43 +0000 (15:09 +0200)]
Use shared setup.yml on azure

Make sure things stay synchronized between different x64 jobs.

4 years agoUse GC stack in nested data removal
Nikita Popov [Fri, 12 Jun 2020 12:57:08 +0000 (14:57 +0200)]
Use GC stack in nested data removal

We should be doing this anyway to prevent stack overflow, but on
master this is important for an additional reason: The temporary
GC buffer provided for get_gc handlers may get reused if the scan
is performed recursively instead of indirected via the GC stack.

This fixes oss-fuzz #23350.

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Fri, 12 Jun 2020 12:09:16 +0000 (14:09 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #79676: imagescale adds black border with IMG_BICUBIC

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Fri, 12 Jun 2020 12:07:16 +0000 (14:07 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79676: imagescale adds black border with IMG_BICUBIC

4 years agoFix #79676: imagescale adds black border with IMG_BICUBIC
Christoph M. Becker [Fri, 5 Jun 2020 14:36:00 +0000 (16:36 +0200)]
Fix #79676: imagescale adds black border with IMG_BICUBIC

We have to loop over all image pixels to avoid the black border.  This
is also done in external libgd in `_gdScaleOneAxis` and `_gdScalePass`.

4 years agoAvoid out of range float to int cast in exif
Nikita Popov [Fri, 12 Jun 2020 10:52:39 +0000 (12:52 +0200)]
Avoid out of range float to int cast in exif

Use convert_any_int instead of convert_any_format to directly get
an integer.

Also adjust SRATIONAL handling to not go through a double division.
This was introduced to avoid SIGFPE for the INT_MIN / -1 case,
but we can just handle that explicitly.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 12 Jun 2020 10:35:57 +0000 (12:35 +0200)]
Merge branch 'PHP-7.4'

4 years agoSuppress deprecation warning in sockets.c
Nikita Popov [Fri, 12 Jun 2020 10:35:02 +0000 (12:35 +0200)]
Suppress deprecation warning in sockets.c

This one was quite a journey...

4 years agoRevert accidental change
Nikita Popov [Fri, 12 Jun 2020 09:34:01 +0000 (11:34 +0200)]
Revert accidental change

Not sure how this happened, but I seem to have reverted
2fd278bc211c2102422c8d8ce0905dfc43cb5c7f
as part of
13868508386208f5a1a43b6c17991ad6f3652fea.

Restore the change.

4 years agoInitialize indentation_uses_spaces field
Nikita Popov [Fri, 12 Jun 2020 09:23:48 +0000 (11:23 +0200)]
Initialize indentation_uses_spaces field

This avoids reading a trap representation from _Bool,
but shouldn't matter as far as behavior is concerned.

4 years agoFix count_commas implementation
Nikita Popov [Fri, 12 Jun 2020 09:04:35 +0000 (11:04 +0200)]
Fix count_commas implementation

Ooops, I did not account for the changing length here.

4 years agoFix null pointer UB in add_assoc_image_info()
Nikita Popov [Fri, 12 Jun 2020 08:54:38 +0000 (10:54 +0200)]
Fix null pointer UB in add_assoc_image_info()

And clean up this function a bit by reducing indentation and
variable scope.

4 years agoMove label to correct position
Nikita Popov [Fri, 12 Jun 2020 08:43:47 +0000 (10:43 +0200)]
Move label to correct position

4 years agoFix null pointer UB in GC
Nikita Popov [Fri, 12 Jun 2020 08:33:39 +0000 (10:33 +0200)]
Fix null pointer UB in GC

This is just plain stupid: In C, it is not permitted to add zero
to a null pointer. In C++, it is permitted.

4 years agoFix float conversion warning
Nikita Popov [Fri, 12 Jun 2020 08:20:10 +0000 (10:20 +0200)]
Fix float conversion warning

We are okay with the loss of precision here...

4 years agoUse unused attribute for _dummy
Nikita Popov [Fri, 12 Jun 2020 08:18:19 +0000 (10:18 +0200)]
Use unused attribute for _dummy

The (void)_dummy is apparently considered a read of an uninitialized
variable. As it is a _Bool now, which has trap representations, this
is no longer considered legal and results in somewhat odd ubsan
warnings of the form:

runtime error: load of value 0, which is not a valid value for type 'zend_bool' (aka 'bool')

4 years agoFix null pointer ub in encoding parsing
Nikita Popov [Fri, 12 Jun 2020 08:05:16 +0000 (10:05 +0200)]
Fix null pointer ub in encoding parsing

And do a bit of drive-by cleanup by extracting count_commas and
reducing some variable scopes.

4 years agoUpdate fuzzer readme
Nikita Popov [Fri, 12 Jun 2020 07:50:52 +0000 (09:50 +0200)]
Update fuzzer readme

Drop --enable-json flag and make it more obvious that clang needs
to be used.

4 years agoMerge branch 'PHP-7.4'
Anatol Belski [Thu, 11 Jun 2020 11:23:35 +0000 (13:23 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  sqlite3: Fix possible use after free

4 years agosqlite3: Fix possible use after free
Anatol Belski [Thu, 11 Jun 2020 11:09:00 +0000 (13:09 +0200)]
sqlite3: Fix possible use after free

Exception should be thrown before the db handle is destroyed.
The backtrace excerpt

==26628== Invalid read of size 4
==26628==    at 0x53C49E3: sqlite3_errmsg (in /usr/lib64/libsqlite3.so.0.8.6)
==26628==    by 0x38C4E9: zim_sqlite3_open (sqlite3.c:142)
==26628==    by 0x8977BF: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1618)
==26628==    by 0x8F801E: execute_ex (zend_vm_execute.h:53824)
==26628==    by 0x8FC0BB: zend_execute (zend_vm_execute.h:57920)
==26628==    by 0x828F54: zend_execute_scripts (zend.c:1672)
==26628==    by 0x793C2C: php_execute_script (main.c:2621)
==26628==    by 0x8FEA44: do_cli (php_cli.c:964)
==26628==    by 0x8FF9DC: main (php_cli.c:1359)

Signed-off-by: Anatol Belski <ab@php.net>
4 years agoUse cheaper variant of zend_hash_index_find()
Dmitry Stogov [Wed, 10 Jun 2020 22:34:55 +0000 (01:34 +0300)]
Use cheaper variant of zend_hash_index_find()

4 years agoFix #73529: session_decode() silently fails on wrong input
Christoph M. Becker [Wed, 10 Jun 2020 12:04:51 +0000 (14:04 +0200)]
Fix #73529: session_decode() silently fails on wrong input

The `php_serialize` decode function has to return `FAILURE`, if the
unserialization failed on anything but an empty string.

The `php` decode function has also to return `FAILURE`, if there is
trailing garbage in the string.

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Wed, 10 Jun 2020 14:45:08 +0000 (16:45 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Update NEWS wrt. bug 79681

4 years agoUpdate NEWS wrt. bug 79681
Christoph M. Becker [Wed, 10 Jun 2020 14:44:17 +0000 (16:44 +0200)]
Update NEWS wrt. bug 79681

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Wed, 10 Jun 2020 14:40:39 +0000 (16:40 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #79681: mime_content_type/finfo returning incorrect mimetype

4 years agoFix #79681: mime_content_type/finfo returning incorrect mimetype
Christoph M. Becker [Tue, 9 Jun 2020 14:22:55 +0000 (16:22 +0200)]
Fix #79681: mime_content_type/finfo returning incorrect mimetype

We backport the respective fix for MP3s[1].

[1] <https://github.com/file/file/commit/5a55569a35eff686d4b7400b219d380f7c622890>

4 years agoMore efficient check for valid class name
Nikita Popov [Wed, 10 Jun 2020 12:50:35 +0000 (14:50 +0200)]
More efficient check for valid class name

Use a bitset of valid characters instead of strspn. This is both
more efficient and more compact.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 10 Jun 2020 12:10:18 +0000 (14:10 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Explicitly start postgres on azure

4 years agoExplicitly start postgres on azure
Nikita Popov [Wed, 10 Jun 2020 11:04:14 +0000 (13:04 +0200)]
Explicitly start postgres on azure

Seems to be necessary now...

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Wed, 10 Jun 2020 10:12:47 +0000 (12:12 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Also support absolute Windows filenames

4 years agoAlso support absolute Windows filenames
Christoph M. Becker [Wed, 10 Jun 2020 09:49:14 +0000 (11:49 +0200)]
Also support absolute Windows filenames

The output normalization of bless_tests.php only detected absolute Unix
filenames; we extend this for absolute Windows filenames, regardless of
the platform we're running on (tests may have been run on Windows, but
bless_tests.php may be run from WSL or a Linux VM, for instance).

4 years agoFix bug #65006
Nikita Popov [Wed, 10 Jun 2020 08:25:50 +0000 (10:25 +0200)]
Fix bug #65006

The "callable name" may be the same for multiple distinct callables.
The code already worked around this for the case of instance methods,
but there are other cases in which callable names clash, such as
the use of self:: reported in the referenced bug.

Rather than trying to generate a unique name for callables, compare
the content of the alfi structures. This is less efficient if there
are many autoload functions, but autoload *registration* does not
need to be particularly efficient.

As a side-effect, this no longer permits unregistering non-callables.

4 years agoSimplify spl_autoload_perform() implementation
Nikita Popov [Wed, 10 Jun 2020 08:14:12 +0000 (10:14 +0200)]
Simplify spl_autoload_perform() implementation

And convert alfi.obj from zval to zend_object*.

4 years agoRemove called_scope inheritance in zend_call_method()
Nikita Popov [Wed, 10 Jun 2020 08:03:43 +0000 (10:03 +0200)]
Remove called_scope inheritance in zend_call_method()

Similar to 097043db2a0d113f89bd26c6f1d7a976d83951a8, but for the
zend_call_method() API. I don't think we ever use this for
static methods, but this logic shouldn't be there. If you want
to inherit the active LSB scope for some reason, do so explicitly.

4 years agoFix called scope assignment in autoloader
Nikita Popov [Wed, 10 Jun 2020 07:55:50 +0000 (09:55 +0200)]
Fix called scope assignment in autoloader

We should use the scope specified in the spl_autoload_register()
call, not whatever LSB scope just so happens to be active at the
time of the autoloader call.

4 years agoRemove autoload_running flag
Nikita Popov [Wed, 10 Jun 2020 07:41:58 +0000 (09:41 +0200)]
Remove autoload_running flag

This was only used to decide between a hash clean and a hash
destroyed in spl_autoload_remove(). But now that
spl_autoload_functions() no longer distinguishes between NULL and
an empty array here, there's really no need to try and destroy
the hashtable here.

4 years agoCleanup SPL autoload implementation
Nikita Popov [Tue, 9 Jun 2020 15:36:36 +0000 (17:36 +0200)]
Cleanup SPL autoload implementation

Replace EG(autoload_func) with a C level zend_autoload hook.
This avoids having to do one indirection through PHP function
calls. The need for EG(autoload_func) was a leftover from the
__autoload() implementation.

Additionally, drop special-casing of spl_autoload(), and instead
register it just like any other autoloading function. This fixes
bug #71236 as a side-effect.

Finally, change spl_autoload_functions() to always return an array.
The distinction between false and an empty array no longer makes
sense here.

Closes GH-5696.

4 years agoControl VCRT leak reporting via environment variable in debug builds
Christoph M. Becker [Wed, 20 May 2020 16:53:40 +0000 (18:53 +0200)]
Control VCRT leak reporting via environment variable in debug builds

Formerly, this had to be enabled by passing the configuration flag
`--enable-crt-debug`; now it can be enabled by setting the environment
variable `PHP_WIN32_DEBUG_HEAP`.  The advantage is that it is no longer
necessary to do separate builds, at the cost of a very minor
performance penalty during process startup.

4 years agoSetup RETURN counters for nested frames
Dmitry Stogov [Wed, 10 Jun 2020 05:10:27 +0000 (08:10 +0300)]
Setup RETURN counters for nested frames

4 years agoMerge branch 'PHP-7.4'
Xinchen Hui [Wed, 10 Jun 2020 03:21:13 +0000 (11:21 +0800)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Partial fixed bug #79649 (Altering disable_functions from module init corrupts memory)

4 years agoPartial fixed bug #79649 (Altering disable_functions from module init corrupts memory)
Xinchen Hui [Wed, 10 Jun 2020 03:16:42 +0000 (11:16 +0800)]
Partial fixed bug #79649 (Altering disable_functions from module init corrupts memory)

In module startup stage, we should not initiliaze
EG(modified_ini_directives) as it use zend MM, the zend MM will be
restart at the end of modules startup stage,

by say "partial", because this issue still exists if altering ZEND_USER
inis, we should add a zend_ini_deactive at the end of modules startup
stage, but it brings some new cost, and I think no one would do things
like that

4 years agoA helper to trace executed source lines
Dmitry Stogov [Tue, 9 Jun 2020 21:13:39 +0000 (00:13 +0300)]
A helper to trace executed source lines

4 years agoTracing JIT support for megamorphic calls
Dmitry Stogov [Tue, 9 Jun 2020 20:33:22 +0000 (23:33 +0300)]
Tracing JIT support for megamorphic calls

4 years agoAvoid unnecessary linking of Windows DLLs
Christoph M. Becker [Wed, 27 May 2020 14:59:54 +0000 (16:59 +0200)]
Avoid unnecessary linking of Windows DLLs

For snapshot builds (`--enable-snapshot-build`), after the build has
been completely finished, running `nmake` causes a lot of DLLs to be
rebuilt.  The problem is that the build folders OptimizerObj and
opcache_jit are dependencies of the main PHP DLL, but these folders do
not exists in the source tree, so nmake assumes it has to re-link the
main PHP DLL, and that makes several other DLLs stale.

We solve that by mirroring the folder structure of the respective
source folders.

4 years ago[ci skip] Fixed some minor typos in code comments
Javier Eguiluz [Tue, 9 Jun 2020 14:55:01 +0000 (16:55 +0200)]
[ci skip] Fixed some minor typos in code comments

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Tue, 9 Jun 2020 14:56:35 +0000 (16:56 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix possibly unsupported timercmp() usage

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 9 Jun 2020 14:54:04 +0000 (16:54 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix possibly unsupported timercmp() usage

4 years agoFix possibly unsupported timercmp() usage
Christoph M. Becker [Tue, 9 Jun 2020 08:12:32 +0000 (10:12 +0200)]
Fix possibly unsupported timercmp() usage

The `timercmp()` manpage[1] points out that some systems have a broken
implementation which does not support `>=`.  This is definitely the
case for the Windows SDK, which only supports `<` and `>`.

[1] <https://linux.die.net/man/3/timercmp>

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Tue, 9 Jun 2020 14:48:41 +0000 (16:48 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #62890: default_socket_timeout=-1 causes connection to timeout

4 years agoRemove obsolete __lambda_func handling
Nikita Popov [Tue, 9 Jun 2020 14:46:58 +0000 (16:46 +0200)]
Remove obsolete __lambda_func handling

This is a leftover from create_function() support.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 9 Jun 2020 14:46:32 +0000 (16:46 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #62890: default_socket_timeout=-1 causes connection to timeout

4 years agoFix #62890: default_socket_timeout=-1 causes connection to timeout
Christoph M. Becker [Tue, 9 Jun 2020 10:42:02 +0000 (12:42 +0200)]
Fix #62890: default_socket_timeout=-1 causes connection to timeout

While unencrypted connections ignore negative timeouts, SSL/TLS
connections did not special case that, and so always failed due to
timeout.

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Tue, 9 Jun 2020 14:40:56 +0000 (16:40 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  [ci skip] Update NEWS

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 9 Jun 2020 14:39:34 +0000 (16:39 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  [ci skip] Update NEWS

4 years ago[ci skip] Update NEWS
Christoph M. Becker [Tue, 9 Jun 2020 14:37:17 +0000 (16:37 +0200)]
[ci skip] Update NEWS

4 years agoBack up fake_scope in zend_call_function
Nikita Popov [Tue, 9 Jun 2020 14:30:46 +0000 (16:30 +0200)]
Back up fake_scope in zend_call_function

We regularly find new places where we forgot to reset fake_scope.
Instead of having to handle this for each caller of zend_call_function()
and similar APIs, handle it directly in zend_call_function().

4 years agoAdd zend_call_known_function() API family
Nikita Popov [Mon, 8 Jun 2020 15:10:24 +0000 (17:10 +0200)]
Add zend_call_known_function() API family

This adds the following APIs:

void zend_call_known_function(
    zend_function *fn, zend_object *object, zend_class_entry *called_scope,
    zval *retval_ptr, int param_count, zval *params);

void zend_call_known_instance_method(
    zend_function *fn, zend_object *object, zval *retval_ptr, int param_count, zval *params);
void zend_call_known_instance_method_with_0_params(
    zend_function *fn, zend_object *object, zval *retval_ptr);
void zend_call_known_instance_method_with_1_params(
    zend_function *fn, zend_object *object, zval *retval_ptr, zval *param);
void zend_call_known_instance_method_with_2_params(
    zend_function *fn, zend_object *object, zval *retval_ptr, zval *param1, zval *param2);

These are used to perform a call if you already have the
zend_function you want to call. zend_call_known_function()
is the base API, the rest are just really thin wrappers around
it for the common case of instance method calls.

Closes GH-5692.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Tue, 9 Jun 2020 13:52:48 +0000 (15:52 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #79683

4 years agoFixed bug #79683
Nikita Popov [Tue, 9 Jun 2020 13:51:05 +0000 (15:51 +0200)]
Fixed bug #79683

Reset fake_scope during __toString() call.

I'll check if we can solve this more globally in master, by
resetting fake_scope in zend_call_function.

4 years agoTracing JIT support for real dynamic calls
Dmitry Stogov [Tue, 9 Jun 2020 11:02:02 +0000 (14:02 +0300)]
Tracing JIT support for real dynamic calls

4 years agoUse standard boolean type as zend_bool typedef
George Peter Banyard [Mon, 8 Jun 2020 10:40:29 +0000 (12:40 +0200)]
Use standard boolean type as zend_bool typedef

Closes GH-5624

4 years agoFix incorrect zend_bool usage for display_errors
George Peter Banyard [Mon, 8 Jun 2020 13:05:58 +0000 (15:05 +0200)]
Fix incorrect zend_bool usage for display_errors