12.9. The OpenCReport\Result class #

12.9.1. Free a result object
12.9.2. Copy a result object
12.9.3. Print a result object
12.9.4. Get result object value type
12.9.5. Detect whether result object value is NULL
12.9.6. Detect whether result object value is a string
12.9.7. Detect whether result object value is a number
12.9.8. Get string value of a result object
12.9.9. Get numeric value of a result object as a string

class OpenCReport\Result {
    public final free(): void;

    public final copy(
                     OpenCReport\Result $src_result):
                     void;

    public final print(): void;

    public final get_type(): long;

    public final is_null(): bool;
    public final is_string(): bool;
    public final is_number(): bool;
    public final get_string(): ?string;
    public final get_number(?string $format): ?string;
}

12.9.1. Free a result object #

Only use it for separately created result objects, like via OpenCReport::env_get() and OpenCReport::result_new(). Not needed for freeing an expression.

public final
OpenCReport\Result::free(): void;

12.9.2. Copy a result object #

Used by unit tests.

public final
OpenCReport\Result::copy(
                     OpenCReport\Result $src_result):
                     void;

12.9.3. Print a result object #

Used by unit tests.

public final
OpenCReport\Result::print(): void;

12.9.4. Get result object value type #

Useful for user functions.

public final
OpenCReport\Result::get_type(): long;

12.9.5. Detect whether result object value is NULL #

Useful for user functions.

public final
OpenCReport\Result::is_null(): bool;

12.9.6. Detect whether result object value is a string #

Useful for user functions.

public final
OpenCReport\Result::is_string(): bool;

12.9.7. Detect whether result object value is a number #

Useful for user functions.

public final
OpenCReport\Result::is_number(): bool;

12.9.8. Get string value of a result object #

Useful for user functions.

public final
OpenCReport\Result::get_string(): ?string;

12.9.9. Get numeric value of a result object as a string #

Useful for user functions. The method may optionally use a format string to specify the number of decimal digits. See MPFR format strings. The returned value may be used with BC Math in PHP or (if the precision is small enough) converted to double or long.

public final
OpenCReport\Result::get_number(?string $format): ?string;