Using array_key_exists() on objects is deprecated

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
lucmaidon
User
Posts: 17

Using array_key_exists() on objects is deprecated

Post by lucmaidon »

Since i try 2010.0.8 after 2010.0.1 this text is display by default in new fields "<br /><b>Deprecated</b>: array_key exists....."

I can enter values without problem, but display is not good.

Help !!!


lucmaidon
User
Posts: 17

Post by lucmaidon »

I submitted my problem to support. Find below the response and resolution elements.

It looks like a problem with PHP 7.4. See: https://www.php.net/manual/en/migration ... ecated.php

Using array_key_exists() on objects
Using array_key_exists() on objects is deprecated. Instead either isset() or property_exists() should be used.

But you said you are using PHP 7.3.12.

We tried to reproduce the problem with PHP 7.3 and 7.4 but there is no problem.

We suspect it is a PHP version issue.

You can try to update the following in phpfn.php and let us know the result:

find:

// Get place holder

public function getPlaceHolder()
{
return ($this->ReadOnly || array_key_exists("readonly", $this->EditAttrs)) ? "" : $this->PlaceHolder;
}

change to:

// Get place holder

public function getPlaceHolder()
{
return ($this->ReadOnly || $this->EditAttrs->offsetExists("readonly")) ? "" : $this->PlaceHolder;
}

WITH THIS MODIFICATION IT'S OK


Post Reply