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

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...