Skip to content

select() does not allow null offset parameter in the strict types mode #154

Closed
@Totktonada

Description

@Totktonada

How to reproduce:

(console 1) $ tarantool
tarantool> box.cfg{listen = 3301}
(console 2) $ phpize && ./configure && make
(console 2) $ php -a -d extension=modules/tarantool.so
php > declare(strict_types=1); print_r($c->select('s', [], 0, null, 0, 'ALL'));
Array
(
    [0] => Array
        (
            [0] => 1
        )

    [1] => Array
        (
            [0] => 2
        )

)
php > declare(strict_types=1); print_r($c->select('s', [], 0, null, null, 'ALL'));
PHP Warning:  Uncaught TypeError: Tarantool::select() expects parameter 5 to be int, null given in php shell code:1
Stack trace:
#0 php shell code(1): Tarantool->select()
#1 {main}
  thrown in php shell code on line 1

The documetation states that $offset parameter is 0 and it is quite natural to expect that when null is passed it'll be considered as zero offset.

See the similar #58.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions