Voting

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

The Note You're Voting On

robinhood70 at live dot ca
4 years ago
Prior to PHP 8, specifying length with zero-length strings or non-string values as input can produce potentially unexpected results.

<?php
foreach (['normal', '', true, false, NULL] as $value) {
echo
gettype(substr($value, 0, 10)) . ' ' . substr($value, 0, 10);
}

/*
string normal
boolean
string 1
boolean
boolean
*/
?>

<< Back to user notes page

To Top