Why do i have different behaviour for following code?
\DB::table('Test')->insert(
array(
'NullableInt' => "NULL", // gives 0
'NullableVarchar' => "NULL" // gives NULL
)
);
I need to parse csv file to seed a table. fgetcsv parses everything as string, for text/varchar fields "NULL" as string works, for integer - not. Why?
nullas in PHP's actual null type and not as a string? The fact its a string probably means at some point in the chain its cast to an int which results in 0 and not null.null(non-string) works. I am interested in this behaviour. Is this a bug? Or why does laravel does that?"NULL"to an int, thus you get 0."NULL"is a string,NULLis not.