Empty string is treated as NULL #35
- Aer Version (or commit ref):
- Operating System: Linux
- System Architecture (eg. arm, x86_64, ...): x86_64
Your problem description
Empty string or string containing special characters like "\n" is treated by PH7 Engine as NULL instead of zero-length string. Quick example:
$x = ''; var_dump(is_string($x));
The above example also fails. It shows:
I suppose, there is a problem with PH7_OP_STORE instruction.
I think it takes the value as it comes from the compiler. From what I checked, it forces type to NULL if string is empty. Seems easy to fix.
$str1 = "This is just a test"; $str2 = ""; $str3 = 'Another test'; $str4 = ''; var_dump($str1); var_dump($str2); var_dump($str3); var_dump($str4);
string(19 'This is just a test') string(0 '') string(12 'Another test') string(0 '')
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?