php
Tagged:  •    •  
Screenshots: 
gophp5screenshot.jpg

Many Drupal developers are excited about the features in PHP 5.2.x and we can hardly wait to start using them in development. Not too recently, however, it was unclear how soon we’d be able to use these features. People worried that if we broke backwards compatibility with PHP 4 we’d lose audience due to the low penetration rate of PHP 5 among web hosts. To fix this, Larry Garfield, Marc Delisle and I launched GoPHP5. We recruited 118 software projects and 208 web hosts to commit to making their default PHP version 5.2.x as of February 5th, 2008. It worked well; shortly after we launched and released our press release, the PHP development team also announced the end of development for PHP 4. Thus the momentum behind PHP 5 has built nicely and we can safely develop Drupal 7 with all of the nice PHP 5 features like PDO, Simple XML and OOP.

When: 
2007
Tagged:  •  

If you want to find out what variables are defined in the current scope during PHP execution, you can use the get_defined_vars() function. This is particularly useful when working in Drupal's .tpl.php files where you want to see what variables are getting passed into the template file.


var_dump(get_defined_vars());

I somehow have a mental block with this function name and usually end up searching for it with terms like "show available variables in PHP", which isn't very helpful, except from now on, when I search for that on Google, I'll get this post to remind me ;-)

See also get_defined_vars(), get_defined_constants() and get_defined_functions().

Syndicate content