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

Anthony Ferrara:
What About Garbage?
December 03, 2014 @ 13:33:44

In his latest post Anthony Ferrara looks at a recent change in the Composer dependency management tool involving a major speed boost, just from disabling the garbage collection.

If you've been following the news, you'll have noticed that yesterday Composer got a bit of a speed boost. And by "bit of a speed boost", we're talking between 50% and 90% speed increase depending on the complexity of the dependencies. But how did the fix work? And should you make the same sort of change to your projects? For those of you who want the TL/DR answer: the answer is no you shouldn't.

He talks about what the actual (one line) change was that sped things up but goes on to talk about why doing this isn't necessarily a good thing. He covers how PHP handles variables internally, how it relates to "pointers" and the copy-on-write functionality. He includes code snippets and gives an overview of how each would be handled by the interpreter. Unfortunately, the way PHP handles things, deleting a variable only removes variable reference, not the value, but does decrement the reference count for it. When that hits 0, garbage collection kicks in and removes associated values too.

He talks about a few other kinds of garbage collection (the reference count method is just one of them) and circles back around to how this relates to Composer's functionality. He points out the number of objects created during the dependency resolution process and what can happen when the root buffer, populated with all of these objects, gets too full (hint: garbage collection). He finishes the post talking about how, in Composer's case, the garbage collection change yielded the performance impact it did, but doesn't suggest it for every project. He also makes a few suggestions as to things that could be done to improve PHP's garbage collection handling.

0 comments voice your opinion now!
garbage collection handling composer disable detail

Link: http://blog.ircmaxell.com/2014/12/what-about-garbage.html

X
September 15, 2011 @ 11:01:04

If you're relatively new to the PHP world, you may be wondering why there has been so much emphasis put on "magic quotes" in the language's past. If you're not entirely sure what they are (and why to avoid them) take a look at this quick overview from XpertDeveloper.com.

First of let me say that Magic Quotes is deprected from the PHP 5.3 and will be removed completely from the PHP 6. But as a developer you might face a situation when you have to work on application which runs on older version of PHP with some older functionality like rely on Magic Quotes.

They introduce the simple concept behind the magic quotes idea and, thankfully, the settings and code you can use to turn it off. It's been deprecated in PHP 5.3 but some older versions came with it enabled. If you're currently running with it on, it's highly recommended to turn it off and refactor your code accordingly.

0 comments voice your opinion now!
magicquotes disable intorduction addslashes phpini


Ruslan Yakushev's Blog:
ASP.NET vulnerability affecting PHP sites on IIS
September 23, 2010 @ 08:50:46

As Ruslan Yakushev points out in this new blog entry, the same security issue that's effecting ASP.NET pages running on IIS web servers can still open up PHP scripts running on the same server.

Microsoft has recently released a Security Advisory about a security vulnerability in ASP.NET. This vulnerability exists in all versions of ASP.NET. The PHP applications running on IIS are also subject to this vulnerability if ASP.NET is enabled in IIS.

The issue allows attackers to access the contents of various files on the server and could allow them to tamper with the data inside. Ruslan notes that, while Microsoft is coming up with a fix, one of the safest things you can do is either completely disable ASP.NET in the IIS server or use this workaround.

3 comments voice your opinion now!
iis vulnerability aspnet disable workaround security


Sameer Borate's Blog:
Disabling the silence @-operator in PHP
July 06, 2010 @ 08:42:22

As Sameer Borate points out in his latest post to his blog, there's a way to disable that pesky suppression operator (@) in your PHP installation thanks to the scream extension.

PHP supports one error control operator: the at sign (@). When prepended to an expression any error generated by that expression will be ignored. It can also be useful for hiding errors generated by various functions. [...] Although quite useful at some times, using the @-operator can have some annoying side effects.

He shows you how to install the extension on a stock Ubuntu platform (including the PHP packages) and how use the feature in your application by means of a call to ini_set (or, of course, setting it in your php.ini file).

0 comments voice your opinion now!
disable supress operator scream extension


Derick Rethans' Blog:
Distributions Please Don't Cripple PHP or Red Hat Stop Fucking Around
February 04, 2009 @ 16:11:11

Derick Rethans has a few choice words for those developing PHP packages for linux distributions out there - don't cripple PHP. His example deals specifically with RedHat and their choices on timezone management.

Red Hat thought it'd be wise to create a patch to use the system provided timezone database instead. We (the PHP development team) thought that to be a bad idea because of several reasons. Among them is that it removes control from PHP's users about which database is, decreased performance, and some missing functionality

He mentions other problems - other issues related to timezone support - that caused them to not accept RedHat's patch to try to "fix" things by disabling the bundled timezone database. He looks at why this is such a bad thing, why it can cause trouble with PHP's date handling and what the future holds for this database support (hint: PHP 5.3 will shake things up).

1 comment voice your opinion now!
redhat distribution package datetime support database disable


Sebastian Bergmann's Blog:
Global Variables and PHPUnit
June 17, 2008 @ 08:49:19

Sebastian Bergmann has a new post today about a feature of the PHPUnit unit testing tool that has the possibility of breaking when objects are introduced - backing up the globals.

It is hard to test code that uses singletons. The same is true for code that uses global variables. Typically, the code you want to test is coupled strongly with a global variable and you cannot control its creation. An additional problem is the fact that one test's change to a global variable might break another test.

You can disable the backup option if you'd like by setting the $backupGlobals option in your test to false. This lets PHPUnit know that you want to leave the globals (and superglobals) alone during the run.

0 comments voice your opinion now!
global variable phpunit unittest backup global superglobal test disable


Inside Open Source:
WordPress Tip #873 Disabling Caching During Development
February 28, 2007 @ 07:38:00

On the Inside Open Source blog today, there's a "quick hit" post from Jason Gilmore for WordPress users out there using the WP-Cache and being frustrated by it's functionality during the development process.

I'm using WordPress to build out a blog for a new endeavor, and couldn't figure out why I had to go through a rather unwieldy refresh process (disabling a template and then enabling it anew) every time I changed it from within the WordPress administration interface.

It was the WP-Caching mechanism that WordPress comes with that was causing the issue, so he tracked down where to disable it for the duration of the development time. (Options -> WP-Cache -> Disable It).

0 comments voice your opinion now!
caching development wordpress wpcache options disable caching development wordpress wpcache options disable



Community Events





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


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

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