Removing warnings and fatals from php-lib/core.php #25

Merged
merged 1 commit into from Nov 8, 2012

Projects

None yet

2 participants

@philix
Contributor
philix commented Apr 23, 2011

Summary: PHP Strict Standards defines you can't declare static methods
abstract, so I just commented the __xhpAttributeDeclaration declaration.

__toString() should not throw "Exception"s, but trigger_error() is accepted, so I
just catch any Exception and trigger an E_USER_ERROR using the exception's
message.

There's almost no trade off as you probably don't handle exceptions converting
XHP objects to strings. If you have some kind of global error handling
you should make sure that the Exception handling and error handling should have
the same behavior.

@philix philix Removing warnings and fatals from php-lib/core.php
Summary: PHP Strict Standards define that you can't declare static methods
abstract, so I just commented out __xhpAttributeDeclaration declaration like
this.

__toString() should not throw "Exception"s, but trigger_error() is accepted, so I
just catch any Exception and trigger an E_USER_ERROR using the exception's
message.

There's almost no trade off as you probably don't handle exceptions when you
convert XHP objects to string. If you have some kind of global error handling
you should make sure that the Exception handling and error handling should have
the same behaviour.
a55d174
@philix
Contributor
philix commented Apr 23, 2011

May be very useful for people trying to use XHP in their up to date PHP environments.

@rvanvelzen rvanvelzen pushed a commit to rvanvelzen/xhp that referenced this pull request Jun 28, 2011
Richard van Velzen Fix for issue #25 on facebook's repo 8434cc4
@philix
Contributor
philix commented Apr 8, 2012

10 months later I realize this commit message has many grammar and style mistakes. :P

@Swahvay Swahvay merged commit 471ed9c into facebook:master Nov 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment