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

Mark Story's Blog:
New errors in PHP 5.4
December 30, 2011 @ 08:30:45

In this quick new post to his blog Mark Story talks about two new errors he ran across when upgrading his installation to PHP 5.4, both showing up under E_ALL.

I've been running the PHP5.4 RC builds for the last few months, and there are some interesting changes in the upcoming PHP release. On top of all the great new features coming in PHP5.4. After updating to PHP5.4-RC4, a few things that used to not trigger errors and silently do the wrong thing, now trigger notices or warnings.

The two he mentions deal with a new warning on illegal string offsets and the other about string offsets ("Notice: String offset cast occurred"). You can find out about more changes in the PHP 5.4 series in the various Changelogs for each Release Candidate and beta release.

0 comments voice your opinion now!
new error update version warning notice offset string


Slawek Lukasiewicz's Blog:
PHP application diagnostics - Memtrack
November 08, 2011 @ 12:08:37

Slawek Lukasiewicz has posted about a handy tool that can be used to track memory consumption and performance in your PHP application - memtrack.

Application profiling can help us determine bottlenecks and possible problems during development. But sometimes we also need to diagnose problems in production environment. Frequent performance problems are connected with functions and methods using too much memory.

The tool allows you to set up thresholds for memory consumption and, if the scripts exceeds it, add warnings to your log files. He includes the simple instructions to install it (via PECL) and enable it in your php.ini. Some sample code to create a memory overvload is included to test it out. Configuration options let you set the limits and define functions to ignore if you know for sure there's trouble spots.

0 comments voice your opinion now!
memtrack extension diagnostic limit warning


PHP.net:
5.3.7 upgrade warning
August 22, 2011 @ 12:32:48

In a quick note from the PHP.net site, they have a warning for those running PHP 5.3.7 (the most recent release) - there's a bug that's serious enough (with crypt) to where upgrades should probably wait until 5.3.8.

Due to unfortunate issues with 5.3.7 (see bug#55439) users should wait with upgrading until 5.3.8 will be released (expected in few days).

The issue causes the crypt() function to only return the (MD5-only) salt it was given instead of the correctly hashed string. If you need to replace this immediately, you can pull the latest from the snaps site (or binaries for Windows). Keep an eye out for PHP 5.3.8 in the near future.

0 comments voice your opinion now!
version crypt salt md5 hash warning upgrade


Lorna Mitchell's Blog:
Declaring Static Methods in PHP
December 10, 2010 @ 08:40:45

Lorna Mitchell has a new post to her blog today talking about static methods and how to use them correctly in your code (as discovered accidentally in her own code).

I was confused recently to realise that I had accidentally called a static method in PHP dynamically from another part of my code; I expected PHP to output warnings when this is done. On closer inspection I discovered that: static functions can be called dynamically and dynamic functions generate an E_STRICT error if called statically.

She illustrates with some sample code that, when run with E_ALL and E_STRICT throws a warning from the strict side about calling a non-static method statically. She also talks about why it throws this warning for the non-static call on a static method. She also explains why, when a static method is called dynamically, no warning is thrown.

0 comments voice your opinion now!
declaring static method warning strict


Misko Hevery's Blog:
Guide Writing Testable Code
January 07, 2009 @ 10:29:39

In this slightly older (Nov 2008) but useful post to Misko's blog, he takes a look at a few common flaws that you should avoid in writing up your code (in any language really).

To keep our code at Google in the best possible shape we provided our software engineers with these constant reminders. Now, we are happy to share them with the world.

Here's the list of the flaws:

  • Flaw #1: Constructor does Real Work
  • Flaw #2: Digging into Collaborators
  • Flaw #3: Brittle Global State & Singletons
  • Flaw #4: Class Does Too Much

Each includes some warning signs to keep an eye out for to see if you and your code might be straying the wrong way.

0 comments voice your opinion now!
testable guide hint flaw avoid warning sign


PHPFreaks.com:
Debugging A Beginner's guide
June 10, 2008 @ 07:59:13

On PHPFreaks.com there's a new tutorial providing a beginner's guide to debugging in PHP (with the built in functionality PHP has, not external software).

Everyday the forums see probably hundreds of topics posted where the problem is a fairly simple error. [...] As a beginner, it can be difficult to find and solve these errors. By tackling each of these in turn, I hope to teach you some methods of finding and solving them.

They look at the different sorts of errors - syntax errors, fatal errors, warnings, notices - as well as some of the ones a bit harder to track down like database problems and logical errors.

0 comments voice your opinion now!
debug beginner guide parse warning fatal error notice


Mindoop Blog:
SEO Warning Zend framework and duplicate content
November 21, 2007 @ 07:54:00

On the Mindoop blog, there's a new post talking about some of the issues that the Zend Framework could cause with the SEO for your site - a simple reason, really.

Zend framework is becoming a first choice framework for a large percentage of PHP developers. It's native support for advanced URL routing makes implementing search engine optimized URLs a breeze. Or not?

Because of the reserved words for the controllers and the multiple ways to access the actions below it (his example is case_studies, case-studies and case)studies) make three different ways to get to the same content - a SEO no-no.

7 comments voice your opinion now!
seo warning zendframework duplicate content seo warning zendframework duplicate content


The Bakery:
Clear the PHP4 warnings when working in eclipsePHP
February 20, 2007 @ 12:47:00

CakePHP users can find a quick hint from The Bakery today pointing out how to get ride of some of the warning messages when working with the framework in PHP4.

CakePHP - a great framework, but sometimes surprising to those who are used to programming with PHP 5. EclipsePHP spits out pages and pages of warnings when compiling towards a PHP 5 base, scaring new CakePHP converts.

The method involves performing a global search and replace on seven key strings to help them conform to the CakePHP standards. The warnings will "magically" disappear following.

0 comments voice your opinion now!
eclipsephp warning php4 cakephp framework search replace eclipsephp warning php4 cakephp framework search replace


Pierre-Alain Joye's Blog:
PEAR Template IT bugs fixes release
April 12, 2006 @ 07:37:38

Pierre-Alain Joye notes today that there were some issues with the PEAR HTML_Template_IT package he's a lead programmer for.

An annoying bug in the ITX callback system introduced a couple of months ago has been fixed. I would force me to write 100 more tests if I forgot again to run them before a release. But the bug seems to not have affected too much people (no related bug report) :-)

The other two are a PHP notice and a warning. For some reason fread decided to raise a warning when the content is zero, it will be fixed in PHP soon, but I still have to fix it in my code.

You can either check out the HTML_template_IT homepage for more or just grab it directly.

0 comments voice your opinion now!
pear html_template_it package callback system notice warning pear html_template_it package callback system notice warning


Vidyut Luther's Blog:
Difference between "require()" and "include()" in PHP
January 05, 2006 @ 06:56:33

On his blog, phpcult.com, Vidyut Luther talks about the difference between require and include in PHP.

This should be well known, and people should be aware as to why they are using either or. But, I've noticed lately that a lot of people new to PHP or programming are not aware of the difference. Depending on what you need you, need to decide what the differences are.

It's a short post, but for someone just getting into PHP, it's some handy information to have. He looks at both functions and gives what they're good for. He does throw in a few caveats, though - including an issue with parse errors in included files pre-PHP 4.3.5...

0 comments voice your opinion now!
different include require fatal error warning different include require fatal error warning



Community Events





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


version library symfony artisanfiles series voicesoftheelephpant interview language composer release tool introduction opinion laravel framework conference list security podcast community

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