PHPverse 2025

Voting

: one minus one?
(Example: nine)

The Note You're Voting On

pcoates at yukon1000 dot com
2 years ago
note there is a behaviour change in php 8

You used to be able to say:
$p1 = trim($_POST['p1']);
This will now throw deprecated warnings if parameter p1 is not set. It is better to say:
$p1 = trim($_POST['p1']??'');
or
$p1 = isset($_POST['p1']) ? trim($_POST['p1']) : null;
or
$p1 = isset($_POST['p1']) ? trim($_POST['p1']) : '';

<< Back to user notes page

To Top