zephir-lang / zephir

Zephir is a compiled high-level language aimed to ease the creation of C-extensions for PHP
https://zephir-lang.com
MIT License
3.29k stars 466 forks source link

[NFR]: Multiple parameter and return types #2428

Open noone-silent opened 3 months ago

noone-silent commented 3 months ago

Allow multiple class return types:

test() -> <Model> | <Row> | null
// or
test() -> <Model | Row> | null

Allow multiple parameter types:

test(array | null data) -> void
Jeckerson commented 3 months ago

Allow multiple class return types

This feature already exists.

noone-silent commented 3 months ago

Allow multiple class return types

This feature already exists.

Probably in C, but not in the generated stub files:

Generated stubs is:

     * @return \Phalcon\Mvc\ModelInterface|\Phalcon\Mvc\Model\Row|null
     */
    public static function findFirst($parameters = null): ModelInterface|null
    {
    }