issue with function xhp_x__base::__xhpAttributeDeclaration()? #21

Closed
jshaw86 opened this Issue Feb 15, 2011 · 4 comments

Projects

None yet

4 participants

@jshaw86
jshaw86 commented Feb 15, 2011

I did a fresh clone from github and got the below error
ErrorException [ Strict ]: Static function xhp_x__base::__xhpAttributeDeclaration() should not be abstract

I hacked it here to fix it: jshaw86@c5457f4, i didn't do a code trace though so I'm not sure what exactly the implication of the fix is. I'm running PHP 5.3.5 in strict error mode, I'll submit a pull request if that is actually correct.

21dec commented Apr 7, 2011

change the php.ini
error_reporting=E_ALL | E_STRICT

Contributor
philix commented Apr 9, 2011

Given how PHP handle inheritance of static methods/attributes it doesn't make sense to make this method abstract.

A fast workaround for this is to provide a implementation that throws an error when called (base::__xhpAttributeDeclaration() should never be called).

protected static function &__xhpAttributeDeclaration() { assert(false); }

Contributor
philix commented Apr 9, 2011

After reading the message on this commit 9d49b01 I think the best solution is to comment the method declaration on the base class.

@Swahvay Swahvay closed this Nov 8, 2012
Contributor
Swahvay commented Nov 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment