 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Freek Lijten's Blog: Currently on PHP's internals - Property Accessors
by Chris Cornutt February 03, 2012 @ 09:39:14
Freek Lijten has posted another "Currently on PHP's internals..." post to his blog today (here's the previous one) with a look at the discussions around the idea of having "property accessors" in PHP - a standardized way of defining getters/setters in objects.
Today I will be discussing a feature that at this moment is called "Property Accessor". It is a method of defining getters and setters. Originally an RFC was defined as early as september 2009, but recently new discussion took place and an actual patch was created. There is no certainty this feature will ever make a PHP version but discussion seems to target implementation details and not the feature itself, so things are looking bright for this feature.
There's two RFCs posted about the topic - the original proposal (from Dennis Robinson) and a patch for implementing them (from Clint Priest). The proposal replaces the common magic getters/setters (__get & __set) with the optional "get" and "set" keywords inside of custom-defined properties.
voice your opinion now!
property accessors proposals rfc internals discussion
Community News: An Effort to Deprecate the MySQL Extension
by Chris Cornutt July 15, 2011 @ 09:48:17
According to this new post to the PHPClasses.org blog today, the core PHP development team has put plans in motion to try to remove the original MySQL extension from the default PHP installation.
PHP core developers are planning to kill the PHP original MySQL extension. If you are using MySQL in your PHP applications for a long time, this may seriously affect you.
Right now it's just in the proposal states (as suggested by Philip Olson) but, if fully acted upon, could have large implications on a number of PHP applications currently using MySQL. For now, though, Philip is only suggesting an education of the PHP user base that they should migrate to either pdo_mysql or mysqli for the future of their apps. Most of the comments following in the mailing list thread are supportive of the effort. They note that it won't be an easy task and, in the end, will still be a "bitter pill" for developers to swallow when the switch is finally thrown.
For the full thread of this discussion, see here and keep clicking through on the "next in thread" link.
voice your opinion now!
mysql extension deprecate educate database mailinglist internals
SimasToleikis' Blog: New to PHP 5.4 Traits
by Chris Cornutt November 22, 2010 @ 09:11:09
Simas Toleikis has a new post to his blog looking at a feature that'll be included in PHP 5.4 - something developers have been wanting for a long time - traits.
As a long-time internals.php mailing list reader I am going to tell you a small secret - the first alpha release for PHP 5.4 should be just around the corner. This release is packed with some welcome new language features, usual bug fixes followed by some performance and memory management improvements. One of the noteworthy language additions are Traits - a brand new horizontal code reuse mechanism.
He explains traits as a better way to do the "kind-of" inheritance that PHP does now with parent and child classes, making it easier to reuse functionality from classes even though they don't share the same parent. With the "use" keyword (not to be confused with the "use" keyword in namespaces) you can include common functionality into class methods and even accommodate for naming conflicts and requirements.
voice your opinion now!
traits new feature internals mixins inheritance
Gopal Vijayaraghavan's Blog: APC 3.1.2 Released!
by Chris Cornutt December 17, 2008 @ 08:47:35
On his blog today Gopal Vijayaraghavan has posted about the release of the latest version of the APC sofware (Alternative PHP Cache) - version 3.1.2.
Finally, after nearly a year of work, it's into a release. Some new stuff has sneaked into it undocumented, that people might find interesting - apc.preload_path would be one of them. The backend memory allocation has been re-done - the api part by me and the internals by shire. There's a hell of a lot of new code in there, both rewritten and added. Tons of php4 cruft removed, php5 stuff optimized, made more stable, then less stable, made faster, then applied brakes. Made leak-proof, quake-proof and in general, idiot-proof. So, on & so forth.
To show the difference, he includes a diff of the current version against the previous - 68 files changed, 3255 insertions and 5545 deletions.
voice your opinion now!
apc cache release version memory allocation api internals php4 php5
Lukas Smith's Blog: PHP 5.3.0alpha3 is finally out
by Chris Cornutt December 05, 2008 @ 09:31:26
As Lukas Smith mentions, the latest alpha release for the PHP 5.3 series has been released - PHP 5.3alpha2.
Wow, after what feels like ages PHP 5.3.0alpha3 was just released. Originally we hoped to be able to release now intermediate releases every 2-3 weeks, this one took a good 2 months. Somehow this releases did its very best to stall itself. People that needed to work on things together by chance ended up being busy with other things and vacations in just the right order to make things impossible. Most of this was to be attributed to the namespace discussions, which climaxed in the backslash FUD campaign.
He notes that a stable release is probably looking good in Q1 of 2009 (with namespaces being the delaying factor). He also suggests something that could help make things a bit simpler in the future - making the internals@ mailing list read-only for anyone outside of core developers. A good bit of the confusion and bickering came from those outside the dev team and it didn't help the group come to a decision any earlier.
You can find the official release information for the alpha2 on the main PHP.net website.
voice your opinion now!
php5 alpha2 release namespace internals mailing list readonly
Sara Golemon's Blog: How long is a piece of string?
by Chris Cornutt June 19, 2006 @ 05:56:03
Sara Golemon, inspired by an IRC discussion has gathered together some of her thoughts on "using PHP's string interpolation without using an optimizer".
She explains how a simple string (an echo statement) is interpreted into a simple compilation structure. Her next step, though (placing a variable inside a string) yields something that seems more complex than it should be. A concatination example simplifies things down a bit, but, oddly enough, it gets even better when a comma is used instead of a period to concatinate. She also gives an example of a heredoc statement that doesn't conform to the interpolation standards you'd think.
Why does this happen? Because there are about a dozen ways that a variable can be hidden inside an interpolated string. Similarly, when looking for a heredoc end-token, the token can be an arbitrary length, containing any of the label characters, and may or may not sit on a line by itself. Put simply, it's too difficult to encompass in one regular expression.
She specifically mentions the APC caching system and its built-in optimizer to help with some of these issues. It pulls the interpolations back down to a size they should be and anticipating operations by pre-resolving things like constants and scalar expressions.
Of course, not everyone can install this pacakge, so she suggests an alternative:
You can still avoid 90% of the INIT_STRING/ADD_STRING dilema by simply using single quotes and concatenation (or commas when dealing with echo statements). It's a simple trick and one which shouldn't harm maintainability too much, but on a large, complicated script, you just might see an extra request or two per second.
voice your opinion now!
internals string concatination opcodes period comma heredoc apc internals string concatination opcodes period comma heredoc apc
|
Community Events
Don't see your event here? Let us know!
|