I have a the following class abstract class Discount { public static abstract function getId(); } PHP: The error I am getting is the following Now I found this here: http://uk.php.net/manual/en/migration52.incompatible.php (sorry can''t paste links at the moment) What is the best way to fix it? can I just remove the static from the function declaration? If so will it have any effect on the way the function works etc?
Is there any specific reason you're using an abstract class instead of an interface in the situation you're describing?
Okay. An abstract and static function doesn't really make much sense. I'd say to fix the error, remove the "abstract" declaration and just do like this: [COLOR=#111111][FONT=monospace]abstract [/FONT][/COLOR][COLOR=#000000][FONT=monospace][B]class[/B][/FONT][/COLOR][COLOR=#111111][FONT=monospace] Discount [/FONT][/COLOR][COLOR=#009900][FONT=monospace]{[/FONT][/COLOR] [COLOR=#111111][FONT=monospace] [/FONT][/COLOR][COLOR=#000000][FONT=monospace][B]public[/B][/FONT][/COLOR][COLOR=#111111][FONT=monospace] static [/FONT][/COLOR][COLOR=#000000][FONT=monospace][B]function[/B][/FONT][/COLOR][COLOR=#111111][FONT=monospace] getId[/FONT][/COLOR][COLOR=#009900][FONT=monospace]([/FONT][/COLOR][COLOR=#009900][FONT=monospace])[/FONT][/COLOR][FONT=monospace][COLOR=#339933]{}[/COLOR][/FONT] [COLOR=#009900][FONT=monospace]}[/FONT][/COLOR] Code (markup):