doc:appunti:linux:sa:debian_upgrade_11_12
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:appunti:linux:sa:debian_upgrade_11_12 [2026/06/29 17:18] – [Accesso SSH a vecchie installazioni] niccolo | doc:appunti:linux:sa:debian_upgrade_11_12 [2026/07/20 18:12] (current) – [Sintassi per costruttore di classe PHP] niccolo | ||
|---|---|---|---|
| Line 58: | Line 58: | ||
| ===== PHP ===== | ===== PHP ===== | ||
| + | |||
| + | ==== get_magic_quotes_gpc() ==== | ||
| Con l' | Con l' | ||
| + | |||
| + | ==== Sintassi per costruttore di classe PHP ==== | ||
| + | |||
| + | PHP 4 usava una convezione per i costruttori di classe: un metodo con lo stesso nome della sua classe veniva automaticamente trattato come costruttore ed eseguito su **new className()**: | ||
| + | |||
| + | <code php> | ||
| + | class className { | ||
| + | protected $varName; | ||
| + | function className() { | ||
| + | $this-> | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Tale convenzione è stata deprecata in PHP 7.0 e rimossa completamente in PHP 8.0. Questa è la nuova sintassi necessaria: | ||
| + | |||
| + | <code php> | ||
| + | class className { | ||
| + | protected $varName; | ||
| + | function __construct() { | ||
| + | $this-> | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== PHP dbConnect-> | ||
| + | |||
| + | Con le versioni precedenti di PHP era possibile usare una sintassi del tipo: | ||
| + | |||
| + | <code php> | ||
| + | $stmt = $this-> | ||
| + | if ($stmt) { | ||
| + | // Do something | ||
| + | } | ||
| + | $stmt = $this-> | ||
| + | </ | ||
| + | |||
| + | Con il nuovo PHP è necessario chiudere il primo statement prima di aprirne uno nuovo, altrimenti si ottiene l' | ||
| + | |||
| + | < | ||
| + | PHP Fatal error: | ||
| + | you can't run this command now in / | ||
| + | </ | ||
| + | |||
| + | La soluzione è chiudere lo statement prima di aprirne un altro: | ||
| + | |||
| + | <code php> | ||
| + | $stmt = $this-> | ||
| + | if ($stmt) { | ||
| + | // Do something | ||
| + | $stmt-> | ||
| + | } | ||
| + | $stmt = $this-> | ||
| + | </ | ||
| ===== SpamAssassin ===== | ===== SpamAssassin ===== | ||
doc/appunti/linux/sa/debian_upgrade_11_12.1782746295.txt.gz · Last modified: by niccolo
