Welcome Guest, Not a member yet? Register   Sign In
$this->request variable type error using strpos
#1

After upgrading to version 4.3.0 VsCode gives me a type error

PHP Code:
if (=== strpos($this->request->getGet('todo'), 'modifica_')) 

VsCode (intelephense), gives me an error in $this->request->getGet('todo') - Expected type 'string' Found array|null

I did a test by checking the type with

PHP Code:
echo gettype($this->request->getGet('todo')); 

It correctly returns me string

The only way to make the error go away is to cast to string

PHP Code:
if (=== strpos((string)$this->request->getGet('todo'), 'modifica_')) 

The application works in all three ways, but I would like to understand what it depends on
Reply




Theme © iAndrew 2016 - Forum software by © MyBB