Skip to content

Commit e127f3f

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Redefine PDOException::$code with correct type
2 parents f25a380 + 96a5026 commit e127f3f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

ext/pdo/pdo.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
class PDOException extends RuntimeException
66
{
7+
/** @var int|string */
8+
protected $code = 0;
79
public ?array $errorInfo = null;
810
}
911

ext/pdo/pdo_arginfo.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 52ee252fdfc80d4d076f1c49842e333c27ed5102 */
2+
* Stub hash: 8d975a20d009e827f8d72ac19b94b55870b6bf9c */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pdo_drivers, 0, 0, IS_ARRAY, 0)
55
ZEND_END_ARG_INFO()
@@ -25,6 +25,12 @@ static zend_class_entry *register_class_PDOException(zend_class_entry *class_ent
2525
INIT_CLASS_ENTRY(ce, "PDOException", class_PDOException_methods);
2626
class_entry = zend_register_internal_class_ex(&ce, class_entry_RuntimeException);
2727

28+
zval property_code_default_value;
29+
ZVAL_LONG(&property_code_default_value, 0);
30+
zend_string *property_code_name = zend_string_init("code", sizeof("code") - 1, 1);
31+
zend_declare_property_ex(class_entry, property_code_name, &property_code_default_value, ZEND_ACC_PROTECTED, NULL);
32+
zend_string_release(property_code_name);
33+
2834
zval property_errorInfo_default_value;
2935
ZVAL_NULL(&property_errorInfo_default_value);
3036
zend_string *property_errorInfo_name = zend_string_init("errorInfo", sizeof("errorInfo") - 1, 1);

0 commit comments

Comments
 (0)