News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso's Blog:
Strange behavior in PHP with method visibility
May 28, 2012 @ 18:09:08

In his recent post Gonzalo Ayuso shares some "strange behavior" he found with method visibility in his recent development:

Normally I feel very comfortable with PHP, but not all is good. There's some things I don't like. One is the lack of real annotations and another one is this rare behaviour with visibility within the OO. Let me explain this a little bit.

The problem came up as a part of a recent refactor where a protected method, when called from an object injected into another class, threw an "access" error that it was called from the wrong context. He reported it as a bug but was reminded of how PHP handles exposure - on the class level, not the instance of a class level.

0 comments voice your opinion now!
behavior method visibility bug refactor


blog comments powered by Disqus

Similar Posts

Pierre-Alain Joye's Blog: htscanner 0.6.1

Padraic Brady's Blog: PHPMutagen: Mutation Testing for PHP5

David Parra's Blog: Calling Conventions – when you need to know C to understand PHP

Community News: PHPBenelux BugHuntDay 2010 (Zend Framework & Joind.in)

Alexander Netkachev's Blog: Controller/Action versus Folder/Page


Community Events

Don't see your event here?
Let us know!


library podcast version community xdebug laravel release framework voicesoftheelephpant introduction conference example api series interview php7 symfony2 opinion extension performance

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework