PHP 8.4.24 Released!

Voting

: min(four, one)?
(Example: nine)

The Note You're Voting On

Jean
7 years ago
When a value can be of "unknow" type, I find this conversion trick usefull and more readable than a formal casting (for php7.3+):

<?php
$time = time();
$string = 'This is a test: ' . $time;
echo (strpos($string, $time) !== false ? 'found' : 'not found');
echo (strpos($string, "$time") !== false ? 'found' : 'not found');
?>

<< Back to user notes page

To Top