<?php
$values = ['', 0, '0', false, null];
foreach($values as $value) {
echo var_export($value, true) . ' => ' . var_export($value != null, true) . ' <=>' (bool)$value . "\n";
}
- Output for 7.0.0 - 7.0.25, 7.1.0 - 7.1.11
- Parse error: syntax error, unexpected '(bool)' (bool) (T_BOOL_CAST), expecting ',' or ';' in /in/i0uuf on line 6
Process exited with code 255.
preferences:
159.38 ms | 962 KiB | 7 Q