Jump to content

Problema PHP


Konti.

Recommended Posts

Salut, am eroarea data :

PHP Parse error:  syntax error, unexpected '?'

la linia :

 

protected function finishSave(array $options)
    {
        $this->fireModelEvent('saved', false);

        if ($this->isDirty() && ($options['touch'] ?? true)) {
            $this->touchOwners();
        }

        $this->syncOriginal();
    }

 

 

Edited by Konti.
Link to comment
Share on other sites

  • Moderators

Null coalescing operator (acel ?? de dupa $options['touch'] ) e disponibil odata cu PHP7 ( link ).

Eventual poti inlocui cu structura echivalenta pt versiuni < 7:

protected function finishSave(array $options)
{
    $this->fireModelEvent('saved', false);

    if ($this->isDirty() && ( isset($options['touch']) ? $options['touch'] : true)) {
        $this->touchOwners();
    }

    $this->syncOriginal();
}

 

Link to comment
Share on other sites

4 hours ago, Roberth said:

Cand incerci sa instalezi ce?

Ce versiune de php folosesti?

Un panel SA:MP, mai bine spus sa-l conectez.

1 hour ago, Courage said:

Null coalescing operator (acel ?? de dupa $options['touch'] ) e disponibil odata cu PHP7 ( link ).

Eventual poti inlocui cu structura echivalenta pt versiuni < 7:


protected function finishSave(array $options)
{
    $this->fireModelEvent('saved', false);

    if ($this->isDirty() && ( isset($options['touch']) ? $options['touch'] : true)) {
        $this->touchOwners();
    }

    $this->syncOriginal();
}

 

Incerc imediat.

 

Iarasi, Parse error: syntax error, unexpected '?' , doar ca pe alta linie :

 

protected function getKeyForSaveQuery()
    {
        return $this->original[$this->getKeyName()]
                        ?? $this->getKey();
    }

 

Link to comment
Share on other sites

  • Moderators
11 hours ago, Konti. said:

Iarasi, Parse error: syntax error, unexpected '?' , doar ca pe alta linie :


protected function getKeyForSaveQuery()
    {
        return $this->original[$this->getKeyName()]
                        ?? $this->getKey();
    }

 

A ?? B
// este echivalent cu
isset(A) ? A : B

In cazul tau

protected function getKeyForSaveQuery()
{
    return isset( $this->original[$this->getKeyName()] ) ? $this->original[$this->getKeyName()] : $this->getKey();
}

 

Link to comment
Share on other sites

23 hours ago, Courage said:

A ?? B
// este echivalent cu
isset(A) ? A : B

In cazul tau


protected function getKeyForSaveQuery()
{
    return isset( $this->original[$this->getKeyName()] ) ? $this->original[$this->getKeyName()] : $this->getKey();
}

 

Parse error: syntax error, unexpected '' (T_STRING), expecting function (T_FUNCTION)
imi eroare de mai sus cand am inlocuit

Link to comment
Share on other sites

La ce linie iti da mai exact eroarea asta? Lasa si tu codul aici. 

De fapt inainte de toate, mai bine stergi toate modificarile pe care le-ai facut si fa upgrade la PHP7. Nu stim cat de masiva e platforma pe care o folosesti tu aici si am putea sta saptamani sa tot corectam erori asa.

Dupa update, daca mai apar erori, revino.

  • Like 3
Link to comment
Share on other sites

On 9/11/2018 at 5:17 AM, Portocala said:

La ce linie iti da mai exact eroarea asta? Lasa si tu codul aici. 

De fapt inainte de toate, mai bine stergi toate modificarile pe care le-ai facut si fa upgrade la PHP7. Nu stim cat de masiva e platforma pe care o folosesti tu aici si am putea sta saptamani sa tot corectam erori asa.

Dupa update, daca mai apar erori, revino.

Si cum il fac ?

Link to comment
Share on other sites

Cauta MultiPHP Manager in CPanel si dupa bifeaza domeniul pe care vrei sa schimbi versiunea, si in dreapta sus inainte de listq cu domenii ai un dropdown de unde sa alegi versiunea. Apasa pe save sau ce ai tu acolo and problem solved. 

 

Link to comment
Share on other sites

  • 8 months later...

 
Bună ziua, mulțumesc pentru informații
On 13/09/2018 at 09:42, Portocala said:

Cauta  MultiPHP Manager  dans le système de gestion des soins de la peau et des soins de santé Rachat prêt , ainsi que dans les stratégies de gestion, les stratégies de gestion, les stratégies de gestion, les stratégies de gestion des droits de copie et les stratégies de sauvegarde. Apasa pe enregistrer une solution au problème et résoudre le problème. 

 

Bună ziua, mulțumesc pentru informații
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.