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

Derick Rethans:
Dead Code
June 18, 2014 @ 10:49:56

In his latest post Derick Rethans talks about something that plagues every project, PHP or otherwise, after its grown to a large enough size: dead code. He's been asked why his Xdebug tool finds this code in places where people don't expect, so he figured he'd answer it once and for all.

The explanation for this is rather simple. Xdebug checks code coverage by adding hooks into certain opcodes. Opcodes are the building blocks of oparrays. PHP converts each element in your script - main body, method, function - to oparrays when it parses them. The PHP engine then executes those oparrays by running some code for each opcode. Opcodes are generated, but they are not optimised. Which means that it does not remove opcodes that can not be executed.

He gets down to the opcode level and shows some output from vld on how things are being executed (and what's not). Using a simple "foo" function example, he shows the execution flow and how the "branches" of executions work through the code. In his case, the "dead code" marker is coming from the line with a closing brace from an "if" statement. He points out that it entirely depends on the lines executed as to what is marked as "dead code".

0 comments voice your opinion now!
dead code xdebug path flow branch vld

Link: http://derickrethans.nl/dead-code.html

Design Aeon:
Check Dead Links From Database Using PHP CURL
June 18, 2012 @ 09:45:55

On DesignAeon.com there's a recent tutorial posted showing you how to extract URLs from your database and determine which ones are "dead" automatically with the help of cURL.

Checking Deadlinks From the database manually is a Headache ,So why not use a script which return the http status of the particular link and tell us if the link is dead or not.So how do we check the dead links from the database ? How do we programatically check whether the link is dead or not ? To check broken or dead links from Database we will use curl .

Included in the post is a sample script that extracts the URLs from a field in the database (you'd need some extra smarts if you're pulling it from content) and running it though a "checklink" function. If the call to curl_getinfo returns false, the link is marked dead.

0 comments voice your opinion now!
dead link url curl check automatic tutorial database


Derick Rethans' Blog:
More source analysis with VLD
February 23, 2010 @ 10:49:26

Derick Rethans has been working on some updates to a tool he's developed, VLD, to make it more helpful and effecting in optimizing the opcodes in your scripts and find the dead opcodes and paths. He talks about these updates in this recent post.

Recently I've been working on some new functionality to visualise all the code paths that make up each function. These new routines sit on top of the routines that do dead code analysis. These new routines sit on top of the routines that do dead code analysis. Every branch instruction (such as if, but also for and foreach) is analysed and a list of branches is created. [...] Once all the branches and their links are found, another algorithm runs to figure out which paths can be created out of all the branches.

He illustrates with a few examples, showing both the command that was executed and the resulting output with the new path information of a simple test file using a "for" loop and an "if/else" conditional.

0 comments voice your opinion now!
vld opcode visualize dead path


Hasin Hayder's Blog:
International PHP-Magazine - Is it dead?
January 28, 2008 @ 08:59:00

Hasin Hayder asks a question in his latest blog post that some in the PHP community have been wondering for a while now - is the International PHP Magazine dead?

I am a subscriber of International PHP Magazine for years. I bought the subscription looking at the back issues. They were sexy, resourceful and yup, very good. But I think these guys don't care about the magazine anymore. It became just a funny stuff for them. All the readers/subscribers and viewers doesn't bring any value to them. Look what they are doing actually...

He points out six things that the magazine and its staff are doing including RoR articles in an issue, content on the site that's way out of date and the smaller size of recent issues. Comments to the post point out that there has been issues released but that the magazine is published by a non-technical company that just might be pushing this particular publication aside.

0 comments voice your opinion now!
international magzine dead issue content old


Tectonic.co.za:
PHP is dead. Long live PHP!
July 21, 2006 @ 05:53:53

In this post from Jason Norwood-Young, he shares his opinions on the lifespan of PHP - that maybe, just maybe, PHP has passed its prime.

A friend recently told me that PHP is on its way out, Ruby on Rails is where it's at. I scoffed. I chuckled. Then I gave it some thought. Could PHP have had its day?

[After my research] I have to conclude that my friend might be right in one respect - PHP has had its day. If the trend continues, it means that PHP will one day not be the hottest thing on the web like it is right now.

He's not abandoning ship just yet, though - he notes that:

PHP still has plenty of legs, and it will take quite a bit to wind it. I'm not sure what will take its place, but somehow I don't think Ruby on Rails will be the successor. PHP's advantage over the rest is that it's a web application, through and through. It doesn't try to also be a desktop application language, a server application language, a widget application language... it just spits out web pages fast and efficiently.

1 comment voice your opinion now!
dead lifespan rubyonrails usage trend dead lifespan rubyonrails usage trend



Community Events





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


library application framework interview list wordpress threedevsandamaybe code community developer laravel language bugfix configure series project release introduction podcast api

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