Non-static Method Should Not Be Called Statically

Published: February 5, 2013

While working with classes and functions you may come across an error which is non-static method should not be called statically.  The error may be thrown at execution time or if you’re working in your IDE it may be highlighted as a code sniff or syntax error.  Either way, it needs to be fixed.  This post will show you two ways that you can fix this problem. Read more…

The Sieve of Eratosthenes In PHP

Published: July 3, 2012

I was recently teased with a fun coding exercise and that required some fundamental mathematical and problem solving skills. I did have to do a little research that led me to the Sieve of Eratosthenes, an ancient algorithm for finding all of the prime numbers up to a given limit. Here’s more about the coding exercise. Read more…

Getting Started With PHP_CodeSniffer

Published: May 1, 2012

PHP_CodeSniffer is a PHP5 script that tokenises PHP, JavaScript and CSS files to detect violations of a defined coding standard. It is an essential development tool that ensures your code remains clean and consistent. It can also help prevent some common semantic errors made by developers.  See PHP_CodeSniffer.  Let’s get started with PHP_CodeSniffer. Read more…

Warning: Expression Result Is Never Used

Published: January 17, 2012

I was recently quality control checking some code and decided to run the code analyzer in my IDE, Zend Studio, as an ancillary step in my review process.  I received a couple of warnings which stated “Expression result is never used”.  Despite the warning the PHP code worked just fine.  After further investigation I discovered why the analyzer was throwing the warning message. Read more…

Warning: Assignment In Condition

Published: January 3, 2012

I was recently writing some simple procedural scripts without using my favorite framework, Zend Framework, and was using the code analyzer in my IDE, Zend Studio, when I got an “Assignment in condition” warning.  Some of the code I had copied directly from php.net.  When I looked further into the warning I discovered the problem. Read more…

Next Page »

Home · About · Domains · Hosting · Development · Portfolio · Blog · Contact · Legal Disclaimer · Privacy Policy

Copyright © 2013 · Lively Web Design