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. Ready for PHP & MySQL Week at SitePoint? To celebrate the release of the new edition of well-loved...
  2. Interactive CLI password prompt in PHP Just a quick tip, since I spent a good hour...
  3. Boost your PHP Performance 50% with HipHop Facebook's soon-to-be-released PHP "code transformer," dubbed HipHop, promises performance gains...
  4. How to Use PHP Namespaces, Part 3: Keywords and Autoloading In the final part of his series explaining PHP namespaces,...
  5. 16 PHP Frameworks To Consider For Your Next Project Why spend valuable time coding everything by hand? Using a...

This post has 61 responses so far