News Feed
Sections




News Archive
feed this:

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

DZone.com:
Cloning in PHP
May 17, 2013 @ 11:09:42

In this recent post over on DZone.com Giorgio Sironi takes a look at the "clone" feature of PHP - what it is, how it can be used and things to watch out for in its use.

Cloning is an operation consisting in the duplication of a data structure, usually to avoid the aliasing problem of having different code modify the same instance in inconsistent ways. In PHP, cloning can be accomplished in multiple ways - and in some cases it can be avoided altogether.

He talks some about how objects are passed around internally during the PHP execution and how you can tell if a function works with data by reference (from the manual). He then looks at the "clone" keyword and what kinds of things are duplicated from an object when it is used. He briefly touches on the "__clone" magic method for solving the "shallow clone" problem and how, possibly, serializing the object might be a better alternative for reproducing the entire object.

0 comments voice your opinion now!
clone introduction object reference serialize shallow deep

Link: http://css.dzone.com/articles/cloning-php

Padraic Brady's Blog:
Zend Framework Survive The Deep End Update
March 25, 2009 @ 07:54:35

For those wondering about the status of his book, "Zend Framework: Survive The Deep End", Padraic Brady has posted an update of where he's at.

Since the rumor mill has been active a while, I confirm two chapters of the book will be released this week. [...] To kick off a new spell of book updates, the next Chapter will be "A Simple Hello World Example", with an Appendix titled "Virtual Hosts On Apache 2". The following Chapter approximately one week later will be an introduction to the application to be built for most of the first half of the book.

He notes that, while normal print books usually have schedules, self-publishing is a bit more flexible. He does want to assure the readers of the book that work is actively being done and the chapters will keep coming.

0 comments voice your opinion now!
zendframework book padraicbrady deep end survive book release chapter


Padraic Brady's Blog:
Zend Framework Survive The Deep End - Still Kicking )
February 10, 2009 @ 09:34:38

Padraic Brady has an update about his "Zend Framework: Survive the Deep End" book he's been self-publishing on his site including a change to his current donation set up.

In experimenting with making money (so I can buy that Macbook Pro) I'll be adding some changes to how donations work. One main change is that while the current PDF file for the existing chapters will remain available (including future updates), PDF files covering the entire book to date will only be available to those who donate.

The online HTML-only version of the chapters will always be free of charge, but the PDFs (from here on out) will be for those who donate. He is also considering adding screencasts to the series to provide a bit more interactive feel to the whole Zend Framework topic.

0 comments voice your opinion now!
zendframework book selfpublish survive deep end donate pdf html


PHPImpact Blog:
Analysis of coupling within the Zend Framework
June 09, 2008 @ 07:56:00

As the PHP:Impact blog points out there's a new post from Neil Garb talking about the (loose) coupling going on inside the Zend Framework.

One of the Zend Framework's strongest drawing cards, as I see it, is its loosely-coupled structure. The name Zend Framework may be a misnomer, in fact, as ZF is more a set of reusable libraries than an actual application framework. I won't go into detail about the advantages of loose coupling, but a recent discussion on the ZF mailing list prompted me to investigate just how loosely coupled the framework is.

He's created a few graphs to show the extent of the coupling - a directed graph, the density of it and example code showing deep and shallow coupling. Here's his results.

0 comments voice your opinion now!
analysis coupling zendframework graph deep shallow


Richard Lord's Blog:
PHP 5.2 - Nesting level too deep - recursive dependency?
November 13, 2006 @ 10:02:00

So, you've just upgraded to PHP 5.2 and all is going well until you come across a page in your application that gives the message "Nesting level too deep - recursive dependency?". With such a vague error message, you might have trouble locating the source of the problem. Thankfully, someone's already been there and figured out the issue - Richard Lord.

I installed PHP 5.2 on one of my testing servers today and a couple of bits of code that previously worked fine in version 5.1.6 threw fatal errors in the new version. The error message was "Nesting level too deep - recursive dependency?" and it took a little time to track down the root of the problem. Here's what I'd done wrong.

Basically, his problem was using the "non-strict" evaluation for checking if two objects were equal to each other (== instead of ===). This compares everything about them, down to the properties - even if they're references to other properties inside of the same class (which is where the problem lies).

So, the fix is simple - === instead of == when comparing those objects. You'll be happier for the change.

0 comments voice your opinion now!
php5 nesting level deep recursive dependency compare object php5 nesting level deep recursive dependency compare object



Community Events





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


release list deployment laravel threedevsandamaybe framework language series api symfony podcast bugfix development interview introduction code tips conference zendserver community

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