Re: [RFC] Keep type of reference params

From: Date: Fri, 08 May 2020 06:48:40 +0000
Subject: Re: [RFC] Keep type of reference params
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-110081@lists.php.net to get a copy of this message
---- En lun, 04 may 2020 19:33:51 +0200 Rowan Tommins <rowan.collins@gmail..com> escribió ---- > On 04/05/2020 16:43, Manuel Canga wrote: > > I think I’d be positive of adding inout keyword in > > order to: > > > > - Check type of out is equal to type of param( like example of my first email ). > > - Avoid modifying caller var value when the function throws an exception > > > Another huge advantage of adding inout parameters is that we could make > it mandatory to mark at the call-site, and get the advantages of this > RFC with less of the compatibility hassle of changing the way references > work: https://wiki.php.net/rfc/explicit_send_by_ref > > We'd still need to figure out how to smoothly transition built-in > functions to use inout rather than by-ref parameters; but then we > already have magic "prefer-ref" in internal functions, so maybe we could > come up with some kind of "prefer-inout". > Hi, Rowan. That's a good point. If nobody objects to this RFC, could someone give me(manuelcanga user ) karma in order to create wiki page ?. Thanks in adavance -- Manuel Canga

« previous php.internals (#110081) next »