News Feed
Jobs Feed
Sections




News Archive
feed this:

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

PHPMaster.com:
Learning Loops
December 15, 2011 @ 10:15:00

PHPmaster.com has a new introductory tutorial for those just starting out with PHP (or with programming really) talking about using looping structures for sets of data - for, while/do-while and foreach.

A significant advantage of computers is that they can perform repetitive tasks easily and efficiently. Instead of writing repetitive code you can write a set of statements that processes some data and then have the computer execute them repeatedly by using a construct known as a loop. Loops come in several different flavors in PHP: for, while, do-while, and foreach. I'll introduce you to each of them and show you how they can making repetitive tasks straightforward and easy to maintain.

The tutorial explains a use case for each of the loop types and includes a bit of sample code showing how to put it into practice. It also shares two special keywords that can be used to bypass or break out of your current loop - break and continue.

0 comments voice your opinion now!
introduction tutorial loop dataset for while foreach break continue


Rafael Dohms' Blog:
Problem Solving technique #1 Taking a mental break
February 07, 2011 @ 12:08:44

Rafael Dohms has posted a new tip for developers (and really anyone else that has to concentrate on mentally challenging tasks all day) that could sometime help you break through that wall you've hit in your code - take a mental break.

Developers are modern day artists whose masterpieces are not hung on walls but stretched out thin on web servers all over the world, yes that is very poetic, but I really try to look at developers as artists and puzzle solvers. [...] A different activity, to most its the simple act of going to get coffee or water, taking a stroll outside in the fresh air, some like sports, some like games.. everyone has their escape valve.

He gives an example of a friend (Chester) who, when he hit a mark he just couldn't pass, turned to a set of lego blocks to help clear his mind. The subconscious mind kicks in as you preoccupy the conscious and a lot of times the answer floats up to he top with little or no effort.

0 comments voice your opinion now!
problem solving technique mental break developer


Jani Hartikainen's Blog:
Three PHP mistakes that will cause you debugging nightmares
January 22, 2009 @ 12:51:50

Jani Hartikainen has posted about three simple, but hard to find, mistakes that can cause you endless frustration if you're not looking in the right places.

Here's his list:

  • Semicolon after a while - a small problem with big (infinitely looping) consequences)
  • empty() and magic __get method - __get will hit first, then empty
  • Missing semicolon after break or continue - a classic that can make switches and evaluations difficult to debug

Comments on the post include a few others: working with variables by reference, comparisons with == versus === and strpos finding the first character in a string.

0 comments voice your opinion now!
mistake semicolon empty magic break continue debug nightmare


Typical Programmer Blog:
Doing it wrong getters and setters
June 16, 2008 @ 11:19:17

According to this new post on the Typical Programmer blog, using getters and setters in your scripts only adds in a bit of unnecessary coupling and complexity to your scripts that you just don't need.

Today most of the popular programming languages support objects, limiting scope, modularity, passing by value, and sophisticated built-in types. There should be no reason to deliberately expose an object's data to the rest of the code because the language can enforce encapsulation and data hiding.

While not specific to PHP, the post does recommend against them because of one simple reason common to all languages that make them possible - they "break the encapsulation OOP offers". For them, they're like a cheat to get around bad coding practices and are not needed to make a successful application work.

0 comments voice your opinion now!
getter setter break object oriented encapsulation scope bad


PHPClasses.org:
8 defensive programming best practices to prevent breaking your sites
April 26, 2007 @ 11:11:00

As anyone who's been developing applications (web or otherwise) knows, there are certain things that you just don't do when you're doing things like adding features or changing the code of a production application. There are some general rules to follow and this new article on the PHPClasses.org website reminds us of just a few.

This article describes software development practices that have been used to prevent problems that can break Web sites.

Included in his list are things like:

  • Handle unexpected conditions Test your code
  • Monitor your site errors and act upon them
  • Do not disclose errors to the users
  • Do what you can as you can never get defensive enough
He also recommends two resources for some additional reading - the Wikipedia entry for "defensive programming" and a chapter from Getting Real (from 37 Signals) about how to "Get Defensive".

0 comments voice your opinion now!
defensive bestpractices break site defensive bestpractices break site


Lukas Smith's Blog:
Its like everybody sees the wall coming...
October 20, 2006 @ 07:38:00

Despite the release candidates for PHP 5.2.0 marching on, Lukas Smith still has some misgivings about some of the functionality being introduced in the release - specifically about the fatal errors that are going to break a lot of (working) object oriented functionality.

Anyways I just posted the following email to internals in a list attempt to get some of the people with php-dev karma to lift their finger.

In the message, he notes the change he's looking for and a suggestion to get it included before RC6 of the series gets released (which has been released as of this post already).

1 comment voice your opinion now!
fix fatal error object oriented theory functionality break fix fatal error object oriented theory functionality break


Cyberlot's Blog:
Another PHP BC break
November 21, 2005 @ 05:45:50

On cyberlot's blog today, he mentions some additional backwards compatibility bugs that PHP 5.1 and 4.4.1 are adding into the mix.

As of PHP 5.1 and in seems 4.4.1 are adding another BC break one that could break anyone using a object based database library within there custom session handler, and also make any registered shutdown function useless if it relys on objects, although the bugs focus on the session aspect of things.

This isn't something you can just "Document" away like they are trying to do.

Basically they are saying any user made or PHP made object is useless during the shutdown phase of PHP.

I could definitely see this issue causing some headaches for a lot of people out there. For more information on this issue, check out the bug report he refers to...

0 comments voice your opinion now!
backwards compatibility break 5.1 4.4.1 backwards compatibility break 5.1 4.4.1



Community Events











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


example introduction podcast package composer hack facebook code install opinion unittest component security release application language framework hhvm symfony2 overview

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