tags:

views:

480

answers:

3

I'm working on a PHP Client for CouchDB. While browsing through the php.net documentation regarding HTTP and cURL, I came across the PECL_HTTP Extension. At first glance, I think I would like to use this PECL extension instead of cURL because it's much simpler to use, and I'm not doing very complicated HTTP work anyways. Plus I always like trying new things, so I wouldn't mind getting my feet wet.

As far as my question to the StackOverflow community:

  • Has anyone used both the PECL_HTTP and cURL extensions?
  • Does the PECL extension have any serious performance issues?
  • Is the PECL extension as user-friendly as it appears on the surface?
  • Is the tried-and-true cURL library still superior?

Edit: As it turns out, the PECL_HTTP extension uses some of the cURL source code under the hood, so they aren't completely different beasts. Both are also compiled extensions to PHP.

A: 

I haven't try PECL_HTTP yet. I prefer to use cURL, since I can test it out in command line first. Also, cURL is available in standard linux installation, so I can expect it to available in various linux-based hosting. I don't know about PECL availability, because I don't use any of it's function in my code.

Donny Kurnia
+1  A: 

In my opinion CURL is straightforward and easy to pick up. In PHP Cookbook (O'Reilly, 2002) CURL was chosen for various (performance) reasons.

Heiko
cURL ultimately has more features then PECL_HTTP and because it is a compiled code extension, it will always execute faster, and there are far more reference material available for cURL when wanting to accomplish difficult scenarios.
Kitson
@Kitson, PECL extensions are also compiled extensions ;)
Dominic Barnes
... and for IO operations the performance win is minimal - most time is spent on the network.
johannes
+1  A: 

The PECL_HTTP extension has proven much simpler to use, almost cutting my code in half in some places. :)

Dominic Barnes