[PHP-CVS] [php-src] master: Revert "Fix GH-22142: Assertion failure in zendi_try_get_long() on IS_UNDEF."

[email protected] (David Carlier)
Newsgroups php.cvs
Message-ID <[email protected]>
Author: David Carlier (devnexen)
Date: 2026-08-22T13:54:52+01:00

Commit: https://github.com/php/php-src/commit/7a8131e09ce2929b52fea54901661daf7f6b76a2
Raw diff: https://github.com/php/php-src/commit/7a8131e09ce2929b52fea54901661daf7f6b76a2.diff

Revert "Fix GH-22142: Assertion failure in zendi_try_get_long() on IS_UNDEF."

This reverts commit 9e1b285f65a5df3fa5366e6c8241152a4ceb88d4.

Changed paths:
  D  ext/zlib/tests/gh22142.phpt
  M  Zend/zend_operators.c


Diff:

diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index ab8f2c2b54f8..b1b1a39a536a 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -448,7 +448,6 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(const zval *
 				ZEND_ASSERT(Z_TYPE(dst) == IS_LONG);
 				return Z_LVAL(dst);
 			}
-		case IS_UNDEF:
 		case IS_RESOURCE:
 		case IS_ARRAY:
 			*failed = true;
diff --git a/ext/zlib/tests/gh22142.phpt b/ext/zlib/tests/gh22142.phpt
deleted file mode 100644
index 481ffef342aa..000000000000
--- a/ext/zlib/tests/gh22142.phpt
+++ /dev/null
@@ -1,21 +0,0 @@
---TEST--
-GH-22142 (Assertion failure in zendi_try_get_long() on IS_UNDEF)
---EXTENSIONS--
-zlib
---FILE--
-<?php
-
-class Options {
-    public int $level;
-}
-
-try {
-    deflate_init(ZLIB_ENCODING_DEFLATE, new Options());
-} catch (TypeError $e) {
-    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
-}
-
-?>
---EXPECTF--
-Deprecated: deflate_init(): Passing an object for argument #2 $option to deflate_init() is deprecated, call get_object_vars() first instead in %s on line %d
-TypeError: deflate_init(): Argument #2 ($options) the value for option "level" must be of type int, null given
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.