Duplicate declaration of static variable $%s

Description

It is not allowed anymore to declare twice a static variable in a method. This is spotted at compile time.

Example

<?php

function foo() {
     static $a;

     ++$a;

     static $a;
}

?>

Literal Examples

  • Duplicate declaration of static variable $a

Solutions

  • Remove all the static declarations, but one: keep the earliest one.