[PHP-DEV] Is reference counting necessary for a PHP implementation?

2017-09-27 Thread Sidharth Kshatriya
In: https://github.com/php/php-langspec/blob/master/spec/04-basic-concepts.md#reclamation-and-automatic-memory-management > Despite the use of the term refcount, conforming implementations are not required to use a reference counting-based implementation for automatic memory management. Is this

Re: [PHP-DEV] Is reference counting necessary for a PHP implementation?

2017-09-27 Thread Stanislav Malyshev
Hi! > Is this statement correct? If I understand correctly many PHP projects > depend on the deterministic firing of `__destruct()` function to cleanup > SQL transactions or connections and so forth. Yes. But, strictly speaking, you do not have to use specifically refcounting - i.e. having some

Re: [PHP-DEV] [RFC] Pre-draft for PipeOp v2

2017-09-27 Thread Sara Golemon
On Thu, Sep 21, 2017 at 5:13 PM, Stanislav Malyshev wrote: > It'd be also nice then if we could have some syntax that allowed us to > refer to functions/methods as callables - mostly for the benefit of the > code readers and IDEs. I.e. you can do "hello" |> "strtoupper" and

[PHP-DEV] Re: Is reference counting necessary for a PHP implementation?

2017-09-27 Thread Andrea Faulds
Hi there, Sidharth Kshatriya wrote: In: https://github.com/php/php-langspec/blob/master/spec/04-basic-concepts.md#reclamation-and-automatic-memory-management Despite the use of the term refcount, conforming implementations are not required to use a reference counting-based implementation

Re: [PHP-DEV] Is reference counting necessary for a PHP implementation?

2017-09-27 Thread Sidharth Kshatriya
The incrementing of the counter is the easy part. In ref counting, while decrementing the counter for a non-scalar (objects, arrays, etc), if the counter reaches zero we need to follow all the non-scalars referenced by the non-scalar you just made zero (and decrement them too. Also, if any of

Re: [PHP-DEV] [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO

2017-09-27 Thread Adam Baratz
> > following my patch and discussions on this list, here is the RFC requested > by some people here to implement "openBlob" in the pdo_sqlite driver, to > match the "openBlob" method from the SQLite3 extension. Thanks for taking the time to do the writeup. No objections from me. Adam

Re: [PHP-DEV] [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO

2017-09-27 Thread Dan Ackroyd
On 26 September 2017 at 03:03, BohwaZ/PHP wrote: > Kia ora, > > https://wiki.php.net/rfc/implement_sqlite_openblob_in_pdo Couple of questions: > $stream = $pdo->sqliteOpenBlob('test', 'data', 1); I tried reading the code but failed; what happens when this is called on a PDO

Re: [PHP-DEV] [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO

2017-09-27 Thread Lester Caine
On 27/09/17 09:47, Dan Ackroyd wrote: >> https://wiki.php.net/rfc/implement_sqlite_openblob_in_pdo > > Couple of questions: > >> $stream = $pdo->sqliteOpenBlob('test', 'data', 1); > I tried reading the code but failed; what happens when this is called > on a PDO connection that isn't to an

Re: [PHP-DEV] [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO

2017-09-27 Thread Marco Pivetta
On Wed, Sep 27, 2017 at 11:00 AM, Lester Caine wrote: > On 27/09/17 09:47, Dan Ackroyd wrote: > >> https://wiki.php.net/rfc/implement_sqlite_openblob_in_pdo > > > > Couple of questions: > > > >> $stream = $pdo->sqliteOpenBlob('test', 'data', 1); > > I tried reading the code

Re: [PHP-DEV] [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO

2017-09-27 Thread Matteo Beccati
Hi Lester, On 27/09/2017 11:00, Lester Caine wrote: > The bigger question is - Should database specific extensions to PDO be > allowed at all? The WHOLE base of PDO was that it would allow easy data > management between DIFFERENT databases. This should be implemented in a > way that mirrors blobs

Re: [PHP-DEV] [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO

2017-09-27 Thread Matteo Beccati
Hey Marco, On 27/09/2017 11:04, Marco Pivetta wrote: > First time I agree with Lester here, so please take note :-P Anything you say can and will be used against you ;-) > Unless the type of the connection is PDOSQLiteConnection, this specific > patch adds methods that are not interfaced, and

Re: [PHP-DEV] [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO

2017-09-27 Thread Lester Caine
On 27/09/17 10:17, Matteo Beccati wrote: > On 27/09/2017 11:00, Lester Caine wrote: >> The bigger question is - Should database specific extensions to PDO be >> allowed at all? The WHOLE base of PDO was that it would allow easy data >> management between DIFFERENT databases. This should be

[PHP-DEV] Re: [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO

2017-09-27 Thread Christoph M. Becker
On 26.09.2017 at 04:03, BohwaZ/PHP wrote: > following my patch and discussions on this list, here is the RFC > requested by some people here to implement "openBlob" in the pdo_sqlite > driver, to match the "openBlob" method from the SQLite3 extension. > >

Re: [PHP-DEV] [RFC] [Discussion] Implement SQLite "openBlob" feature in PDO

2017-09-27 Thread Matteo Beccati
On 27/09/2017 11:34, Lester Caine wrote: > openBlob is a specific feature of SQLite so the decision to use it > already rules out any other database. IN PDO access to it via the > generic blob functions is the proper way forward so that a call for a > blob gives a blob what ever the underlying

[PHP-DEV] E_RECOVERABLE_ERROR for object to string conversion

2017-09-27 Thread Marlies Heijkoop
Hi Internals, I stumbled upon a difference in behavior between PHP >=7.0 and HHVM when it comes to object-to-string conversion for objects not implementing a `__toString` which caught me by surprise. It's probably a pretty common scenario, especially for inexperienced PHP developers, as all

[PHP-DEV] Re: E_RECOVERABLE_ERROR for object to string conversion

2017-09-27 Thread Christoph M. Becker
On 27.09.2017 at 14:45, Marlies Heijkoop wrote: > Hi Internals, > > I stumbled upon a difference in behavior between PHP >=7.0 and HHVM when it > comes to object-to-string conversion for objects not implementing a > `__toString` which caught me by surprise. > > It's probably a pretty common