- var_dump: documentation ( source)
- explode: documentation ( source)
<?php
function f(string $str): void {
if ($a = explode("-", $str)) {
echo "reached if: ", var_dump($a), "\n";
} else {
echo "unreached else\n";
}
}
f("");
f("a");
f("a-b-c");