Blog Post RSS ?

Blogs » PHP » Reason to like PHP?
 

Reason to like PHP?

by Harry Fuecks

Perl;


print { open my $out, ">", "pidfile"; $out or die } $$, "\n";

Ruby;


File.open('pidfile', 'w+'){ |fh| fh.puts Process.pid }

I could have used ‘$$’ instead of Process.pid, but I prefer readability

PHP;


file_put_contents( 'pidfile', getmypid() );

Yeah I know, I know but anyway…

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Ping.fm
  • Twitthis

Related posts:

  1. Introducing php-tracer-weaver php-tracer-weaver is a tool for automatically generating docblock comments, with...
  2. Ready for PHP & MySQL Week at SitePoint? To celebrate the release of the new edition of well-loved...
  3. Is Ruby’s Popularity Fading? Ruby has enjoyed a ton of hype over the last...
  4. Interactive CLI password prompt in PHP Just a quick tip, since I spent a good hour...
  5. How to Use PHP Namespaces, Part 3: Keywords and Autoloading In the final part of his series explaining PHP namespaces,...

This post has 61 responses so far

Sponsored Links

SitePoint Marketplace

Buy and sell Websites, templates, domain names, hosting, graphics and more.

Follow SitePoint on...