News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:

Stoyan Stefanov's Blog:
PHP-style $GLOBALS in Javascript?
0 comments :: posted Wednesday March 12, 2008 @ 07:55:07
voice your opinion now!

In a new post to his blog today, Stoyan Stefanov has a proposal to being something PHP users are very used to - superglobals - over to Javascript.

Javascript has implied globals. When you skip the var in var a = 1; and go a = 1;, then a becomes a global variable. Some consider this an error in the language. [...] In PHP on the other hand, variables are local. [...] So how about this: adopt the $GLOBALS convention in your JavaScripts?

His example proposes the creation of a GLOBALS object you can assign properties to that can be used anywhere. This helps to keep the variables you truely want to be global contained, though it doesn't do much except provide a convention.

tagged with: superglobal global variable javascript


Michael Kimsal's Blog:
Grails for PHP Developers Part 5
0 comments :: posted Tuesday February 19, 2008 @ 12:02:00
voice your opinion now!

Michael Kimsal points out the posting of the latest part of his "Grails for PHP developers" series to his blog site - Part Five of the series.

I've put up the latest installment in my "Grails for PHP developers". Rather than delve too much more in to Grails head on, I'm taking this installment (and at least the next one) to delve more in to the Groovy language itself. Groovy offers similarities to PHP, but also many differences which can trip you up if you're not careful. I'll try to lay those out as best I can in the next couple of installments.

This new part of the series goes back and puts the spotlight on GRoovy, the base of the Groovy/Grails combo. He talks about working with variables and arrays as containers for multiple pieces of data and some possible gotchas that could come up along the way.

tagged with: grails developer groovy array variable store screenshot

Rails for PHP Developers:
Three New Articles Posted (Scope, Variables & RegEx)
0 comments :: posted Tuesday February 19, 2008 @ 08:44:00
voice your opinion now!

Mike Naberezny has posted a few more articles to the "Rails for PHP Developers" website (based on this book) covering some more of the basics.

There's three new tutorials posted:

  • Ruby Block Scope - the basics of Ruby block scope, a common point of confusion for PHP developers new to Ruby.
  • Variable Arguments - an article that shows two common API patterns found in Rails, variable arguments and option hashes, and how to implement them both in PHP.
  • Regular Expressions in Ruby - a useful reference that maps all of the common PHP regular expression functions to the equivalents in Ruby.

Check out the rest of the site for even more great content.

tagged with: rails development regularexpression variable argument scope ruby

Arnold Daniels' Blog:
Perl like temporary variables in PHP
0 comments :: posted Friday November 02, 2007 @ 09:38:00
voice your opinion now!

Arnold Daniels points out a quick method for creating what he calls "perl-like temporary variables" in the global scope of a script:

When writing code in the global scope, I often have a problem where I'm overwriting a variable. This happens even more often when I work on code of somebody else. Usually has the variable which does the overwriting is usually just a temporary variable.

His code is a simple few lines that shows how it could be used when trying to write information out to a file handle. Some of the comments on the post criticize his use of the global scope but Arnold comes back with his reasoning - mostly that there is already code in the global scope and that adding something else is only adding to it, not making things worse.

tagged with: temporary variable perl global scope temporary variable perl global scope


mysql security release framework zend conference ajax cakephp PEAR job PHP5 book code database application zendframework developer releases pecl package

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