@@ -2173,9 +2173,15 @@ ZEND_API ZEND_COLD void zend_class_redeclaration_error_ex(int type, zend_string
21732173
21742174/* Inlined implementations shared by new and old parameter parsing APIs */
21752175
2176+ typedef enum ZPP_PARSE_BOOL_STATUS {
2177+ ZPP_PARSE_AS_FALSE = 0 ,
2178+ ZPP_PARSE_AS_TRUE = 1 ,
2179+ ZPP_PARSE_ERROR = 2 ,
2180+ } zpp_parse_bool_status ;
2181+
21762182ZEND_API bool ZEND_FASTCALL zend_parse_arg_class (zval * arg , zend_class_entry * * pce , uint32_t num , bool check_null );
2177- ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow (const zval * arg , bool * dest , uint32_t arg_num );
2178- ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak (const zval * arg , bool * dest , uint32_t arg_num );
2183+ ZEND_API zpp_parse_bool_status ZEND_FASTCALL zend_parse_arg_bool_slow (const zval * arg , uint32_t arg_num );
2184+ ZEND_API zpp_parse_bool_status ZEND_FASTCALL zend_parse_arg_bool_weak (const zval * arg , uint32_t arg_num );
21792185ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow (const zval * arg , zend_long * dest , uint32_t arg_num );
21802186ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak (const zval * arg , zend_long * dest , uint32_t arg_num );
21812187ZEND_API double ZEND_FASTCALL zend_parse_arg_double_slow (const zval * arg , uint32_t arg_num );
@@ -2186,7 +2192,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest, u
21862192ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_or_str_slow (zval * arg , zval * * dest , uint32_t arg_num );
21872193ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_or_long_slow (zval * arg , zend_string * * dest_str , zend_long * dest_long , uint32_t arg_num );
21882194
2189- ZEND_API bool ZEND_FASTCALL zend_flf_parse_arg_bool_slow (const zval * arg , bool * dest , uint32_t arg_num );
2195+ ZEND_API zpp_parse_bool_status ZEND_FASTCALL zend_flf_parse_arg_bool_slow (const zval * arg , uint32_t arg_num );
21902196ZEND_API zend_string * ZEND_FASTCALL zend_flf_parse_arg_str_slow (zval * arg , uint32_t arg_num );
21912197ZEND_API bool ZEND_FASTCALL zend_flf_parse_arg_long_slow (const zval * arg , zend_long * dest , uint32_t arg_num );
21922198
@@ -2203,11 +2209,16 @@ static zend_always_inline bool zend_parse_arg_bool_ex(const zval *arg, bool *des
22032209 * is_null = 1 ;
22042210 * dest = 0 ;
22052211 } else {
2212+ zpp_parse_bool_status result ;
22062213 if (frameless ) {
2207- return zend_flf_parse_arg_bool_slow (arg , dest , arg_num );
2214+ result = zend_flf_parse_arg_bool_slow (arg , arg_num );
22082215 } else {
2209- return zend_parse_arg_bool_slow (arg , dest , arg_num );
2216+ result = zend_parse_arg_bool_slow (arg , arg_num );
2217+ }
2218+ if (UNEXPECTED (result == ZPP_PARSE_ERROR )) {
2219+ return false;
22102220 }
2221+ * dest = result ;
22112222 }
22122223 return 1 ;
22132224}
0 commit comments