File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1155,9 +1155,7 @@ public function isDestructor(): bool {
11551155}
11561156
11571157class ReturnInfo {
1158- // REFCOUNT_SCALAR (formerly REFCOUNT_0) is automatically applied for
1159- // scalars, and not allowed for non-scalars
1160- const REFCOUNT_SCALAR = "0 " ;
1158+ const REFCOUNT_0 = "0 " ;
11611159 const REFCOUNT_1 = "1 " ;
11621160 const REFCOUNT_N = "N " ;
11631161
@@ -1201,12 +1199,14 @@ private function setRefcount(?string $refcount): void
12011199 $ isScalarType = $ type !== null && $ type ->isScalar ();
12021200
12031201 if ($ refcount === null ) {
1204- $ this ->refcount = $ isScalarType ? self ::REFCOUNT_SCALAR : self ::REFCOUNT_N ;
1202+ $ this ->refcount = $ isScalarType ? self ::REFCOUNT_0 : self ::REFCOUNT_N ;
12051203 return ;
12061204 }
12071205
12081206 if ($ isScalarType ) {
1209- throw new Exception ("@refcount is not permitted on functions returning scalar values " );
1207+ throw new Exception (
1208+ "@refcount on functions returning scalar values is redundant and not permitted "
1209+ );
12101210 }
12111211
12121212 if (!in_array ($ refcount , ReturnInfo::REFCOUNTS_NONSCALAR , true )) {
You can’t perform that action at this time.
0 commit comments