Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #55942, comment 1


Ignore:
Timestamp:
06/07/2022 08:01:30 PM (3 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #55942, comment 1

    initial v1  
    11There are (at least) three ways this could be implemented:
    22
    3 1. The most basic: `0` would be default and undefined, `1` would mean the data was not serialized when storing it, `2` would mean thew data was serialized.
     31. The most basic: `0` would be default and undefined, `1` would mean the data was not serialized when storing it, `2` would mean the data was serialized.
    44
    552. A better way would be to store the primitive (basic) PHP types: `0` would be default and unset, 1 would be boolean, 2 would be int, 3 would be float, 4 would be string, etc. (https://www.php.net/manual/en/language.types.intro.php). Then the data can be type-casted after retrieving it form the DB. This will also improve/fix one of the long-standing problems with saving a specific type to the DB but retrieving it as a different type, like saving bool `false` but getting string `'0'`.