 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Anthony Ferrara's Blog: PHP's Source Code For PHP Developers - Part 3 - Variables
by Chris Cornutt March 22, 2012 @ 08:30:45
The third part of the "PHP source for developers" series has been posted over on Anthony Ferrara's blog today looking at the variables PHP's internals use.
In this third post of the PHP's Source Code for PHP Developers series, we're going to expand on the prior posts to help understand how PHP works internally. In the first post of the series, we looked at how to view PHP's source code, how it's structured as well as some basic C pointers for PHP developers. The second post introduced functions into the mix. This time around, we're going to dive into one of the most useful structures in PHP: variables.
He starts with one of the most important variable types used in PHP's source - the ZVAL. This is one of the keys to PHP's loose typing and can be thought of as "a class with only public properties". He gets into more detail with the properties of this "class" (value, refcount__gc, type and is_ref__gc). Also included is a look at how it's actually used - creating new ones, getting the value of them, converting their types and how the internal PHP functions parse their variables.
There's a lot more covered about variables in the post so if this is interesting stuff to you, be sure to read it all. They've done a great job of explaining one of the more complicated parts of the internals that power PHP.
voice your opinion now!
source code internals language variables parse type zval
Anthony Ferrara's Blog: Parameter Type Casting in PHP
by Chris Cornutt March 06, 2012 @ 11:05:32
Anthony Ferrara has a new article posted to his site today about parameter typecasting and the discussions that have been happening about it on the PHP "internals" mailing list.
As any of you who follow the PHP internals list know, scalar type hinting has been a hot topic as of late. You'll also know that I've submitted two new RFC (Request For Comment) proposals for inclusion of two new major features in the PHP language. I figured it was worth going into both RFCs and patches a little deeper, explain my rationale and (hopefully) garner some more visibility of the proposals.
He shares the details of the two main RFCs that are proposed right now - parameter type casting hints and object scalar casting magic methods (both with code examples). Right now, they're only in the patch stage and there's talk of improving the current casting functionality of PHP before something like one of these goes into place.
voice your opinion now!
parameter type casting proposals rfc internals mailing list
UMumble.com: Working with memory
by Chris Cornutt February 14, 2012 @ 08:44:02
On the UMumble blog there's a recent post looking at memory consumption in PHP applications - what PHP does for you when managing how it uses your system's memory and what you need to worry about in your code.
There is a widespread view that the ordinary PHP developer does not need to control memory management, but "controlling" and "knowing" are slightly different concepts. I will try to throw light upon some aspects of memory management when working with variables and arrays, and some interesting pitfalls of the internal optimization of PHP. As you can see, the optimization is good, but if you do not know exactly how it is optimized, you might meet the pitfalls, which can make you pretty nervous.
They talk about some of the basics - how variables are stored in hash tables and how this helps memory consumption - as well as using the memory_get_usage method to find your current consumption. This is show for both regular strings and arrays, comparing larger data (and assigning it multiple times) to simpler structures. They also mention how PHP handles memory usage in passing by reference and copying of values.
voice your opinion now!
memory consumption tutorial usage management internals
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
|
Community Events
Don't see your event here? Let us know!
|