PHP 5.4 e funzioni MySQL

PHP 5.4 e funzioni MySQL

Leggevo oggi la trascrizione del podcast contenente un'intervista di PHPClasses a proposito dei cambiamenti che verranno apportati alla versione 5.4 di PHP (attualmente in alfa). Quello che sicuramente colpisce è il fatto che le funzioni MySQL a cui siamo abituati (le vecchie mysql_nome_funzione()) probabilmente non saranno più supportate. Credo sia di fondamentale importanza conoscere questi dettagli qualora fossimo intenzionati in futuro a passare alla versione 5.4 (molti servizi di hosting forniscono questa possibilità in automatico). Vediamo alcuni passaggi dell'intervista.

Ernani Joppert afferma:

[...] it was proposed as you mentioned to discontinue the usage of mysql_ functions, this means by built-in to the core PHP. In my opinion this might be or it might not be a good decision, although this was discussed under the internals of PHP, bringing this to the table so we can talk about it and make our listeners aware of the slight changes that may affect the PHP engine and the PHP core configuration.

I guess it isn't trying to cause any harm but just to make them aware. And as far as I know this is the major big change on the next release of PHP. And the other ones I wasn't much aware, I recall reading about those but it isn't that much fresh in my mind right now.

Joppert precisa che si tratta ancora di una proposta in fase di discussione, ma che se venisse approvata e confermata sarebbe certamente il cambiamento di maggior rilievo per la versione 5.4 di PHP.

Manuel Lemos, l'intervistatore, ribadisce il concetto precedentemente espresso e sottolinea come questa proposta vada vista come un modo per incoraggiare gli sviluppatori ad usare le funzionalità più recenti e moderne di MySQL:

Well, actually for now this, as I mentioned, this is just a proposal to educate users to stop using the old functions, and from what I understood the idea is to encourage the PHP developers to start using functions of newer MySQL extensions that provide certain features like prepared statements.

Se tale proposta venisse confermata, l'impatto maggiore sarebbe sicuramente su quei siti che non dispongono di un framework che ha un approccio più astratto ai database. In particolare verrebbero interessati quei siti che non usano PDO o mysqli ma che sono interamente basati sulle vecchie funzioni MySQL. Per questa tipologia di siti raccomando estrema cautela nell'eventualità di un passaggio a PHP 5.4.

Torna su