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

Matthias Noback:
Setting the stage: Code complexity
Jan 18, 2018 @ 18:29:07

In a post to his site, Matthias Noback talks about code complexity and how this relates to the overall "churn" (the rate of change) in a project.

Code complexity often gets measured by calculating the Cyclomatic Complexity per unit of code. The number can be calculated by taking all the branches of the code into consideration. [...] In general, we always strive for low code complexity. Unfortunately, many projects that you'll inherit ("legacy projects"), will contain code that has high code complexity, and no tests.

[...] Code complexity doesn't always have to be a big problem. If a class has high code complexity, but you never have to touch it, there's no problem at all. [...] What's really dangerous for a project is when a class with a high code complexity often needs to be modified. Every change will be dangerous. [...] Michael Feathers introduced the word "churn" for change rate of files in a project. Churn gets its own number, just like code complexity.

He then talks about combining these two numbers to provide an even more in-depth look at your code. It can give more insight into the relationship between "difficult to change", "number of changes" and the times a file has changed in the past. He mentions "it's okay" thinking (the current state is alright but not great) and shares some of his own hypotheses, observations and advice.

tagged: code complexity churn statistic evaluation combination

Link: https://matthiasnoback.nl/2018/01/churn-legacy-code/

WebTutor.pl:
HipHop for PHP: Benchmark - Revenge of PHP
Apr 20, 2011 @ 18:47:50

On the WebTutor.pl site they've posted the second part of their series looking at the benchmark results from their tests running HipHop. You can find their first post with some of the introductory setup and information here.

In previous article I measured the performance of HipHop for PHP by performing some tests downloaded from the shootout.alioth.debian.org website. Unfortunately the test list was incomplete. Only six tests were selected to avoid potential incompatibility issues with the HipHop compiler.

In this new post he provides the results for two more tests: regex-dna and k-nucleotide. He outlines the testing platform and shares the results of testing some pretty basic scripts. His results were interesting and found that some operations the HipHop compiler actually slowed down.

tagged: benchmark hiphop statistic platform speed

Link:

Tiffany Brown's Blog:
Collecting e-commerce conversion data with Zen Cart and Google Analytics
Feb 19, 2009 @ 17:18:38

Tiffany Brown has a new post today showing how you can gather some statistics about the (successful) use of your e-commerce Zen Cart website with the help of Google Analytics.

Google Analytics allows you to collect pretty robust data about how users move through your e-commerce site. Here’s how to make it work with Zen Cart, an open source shopping cart.

You'll need to already have a Google Analytics account set up for the application, a Zen Cart instance installed and have at least a passing knowledge with using PHP and MySQL. There's two steps to the process - a creation of a custom functions file (code provided) and a modification to two other files (the checkout success page and global footer) to send additional information to the Analytics service.

tagged: zencart ecommerce statistic conversion data google analytics

Link:

Internet Super Hero Blog:
PHP 5.3: Persistent Connections with ext/mysqli
Feb 19, 2009 @ 15:31:33

The Internet Super Hero blog has posted some statistics comparing the connections per second that can be made with the newly introduced persistent connection support coming with PHP 5.3 in the mysqli (ext/mysqli) driver.

Persistent Connections have been a mixed bag. They can give you a significant performance boost by caching (pooling) connections although MySQL is already comparatively fast at establishing connections. However,connections are stored "as-is" in the cache. They are not "cleaned up".

The ext/mysqli driver takes care of this and a few other problems surrounding the persistent connections by cleaning up things like rolling back active transactions, unlocking tables, closing prepared statements and closing handlers. The trick is in a call to the C-API function mysql_change_user() (= COM_CHANGE_USER).

tagged: mysqli ext driver persistent connection trouble solved statistic

Link:

Matt Curry's Blog:
Did You Guys Know About The CakePHP DebugKit?
Jan 27, 2009 @ 14:47:08

Matt Curry points out a tool that several CakePHP developers might not know about - the CakePHP debug kit.

You know when there’s something out there that you know you will like, but for whatever reason you don’t check it out right away. Like the TV show Arrested Development or fleece. That was me with the CakePHP DebugKit. For those even more out of the loop then me, the DebugKit is a CakePHP plugin that adds a bunch of information panels to your app.

The DebugKit gives you some of the vital stats of your CakePHP application at your fingertips. You can grab session information, check out the last request information, get a log of SQL statements, get the loading times of parts of the page, view a log file you can add to and see how much memory the current page of the site is using.

tagged: cakephp framework debugkit debug bar statistic

Link:

Nexen.net:
PHP Statistics for October 2008
Nov 07, 2008 @ 20:39:54

Damien Seguy has passed on the latest PHP statistics for October 2008 on the nexen.net site. Here's a few highlights:

  • This was the last month of PHP 4 dominance
  • PHP 5 tops PHP market share with 47.50% usage
  • PHP 4.4.9's usage is moving even lower

The full stats (including graphs) can be found here and the evolution stats are here.

tagged: statistic usage domain ip php4 php5 october08

Link:

Yannick's Blog:
mbstring vs iconv benchmarking
Oct 06, 2008 @ 17:50:20

Recently on his blog Yannick has done some benchmarking comparing mbstring and iconv in PHP 5.2.4 release.

Following up on my previous post about the differences between the mbstring and iconv international characters libraries (which resulted in a tentative conclusion that nobody knew anything about those differences), and particularly the comments by Nicola, we have combined forces (mostly efforts from Nicola, actually) to provide you with a little benchmarking, if that can help you decide.

His code for the test script is included (for you to gather your own results) and a full listing of his results comparing the effects of possible caching, running up to ten executions. You can download the text file that he ran the script on here.

tagged: mbstring iconv benchmark php5 text file statistic

Link:

DevX.com:
Generating Reports and Statistics in PHP
Jun 27, 2008 @ 15:26:31

The DevX site has posted a new tutorial talking about their method for creating reports and generating statistics based off of data from your PHP application.

Statistics and reports analyze the change over time of any kind of phenomena. [...] For the software industry, statistics and reports provide both an ongoing challenge and an ongoing market. At present, programming languages such as PHP and Java come with built-in packages for developing applications around statistical problems.

They use two PEAR packages for the statistics - Text_Statistics and XML_Statistics to pull in different kinds of data and extract results from it. The next step is to make a meaningful report out of these numbers - that's where PHPReports comes in. It's a simple tool that makes simple reports for you that can then be styled with CSS however you'd like.

tagged: tutorial report statistic pear package textstatistics xmlstatistics phpreports

Link:

Stefan Priebsch's Blog:
PHPUnit test and Code Coverage Statistics with phing
Apr 22, 2008 @ 19:15:18

Stefan Priebsch has posted an example of how he uses PHPUnit "manually" to reduce the overhead (and added complexity) of calling phing.

Instead of instantiating PHPUnit from phing, I use the command line interface to call PHPUnit. This decouples phing and PHPUnit, which should cause less problems with version updates in the future. To configure PHPUnit, phing creates a temporary XML configuration file which is deleted after PHPUnit has finished.

The source is included in the post - it manually builds the XML file needed for phing to do its job.

tagged: phing phpunit codecoverage statistic generate xml

Link:

Ivo Jansch's Blog:
Interview in Computerworld UK
Feb 27, 2008 @ 17:12:00

Ivo Jansch points out a recent interview he was asked to do in the Computerworld UK magazine about the recent launch of the Ibuildings company there in the UK.

I was recently interviewed by Computerworld UK regarding our launch in the UK and the current rise of PHP in the corporate world. The result is online here.

He also asks readers how they see PHP adoption going in their companies: "Post a comment to let me know how 'PHP' and 'Business' go together in your region."

tagged: computerworld uk interview magazine ibuildings adoption statistic

Link:


Trending Topics: