PHP 8.5.0 Alpha 4 available for testing

Voting

: max(five, eight)?
(Example: nine)

The Note You're Voting On

grawity at gmail dot com
17 years ago
re: #80305

Again useful for newbies:

if you need to compare a variable with a value, instead of doing

<?php
if ($foo == 3) bar();
?>

do

<?php
if (3 == $foo) bar();
?>

this way, if you forget a =, it will become

<?php
if (3 = $foo) bar();
?>

and PHP will report an error.

<< Back to user notes page

To Top