TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-30-2009, 02:07 PM   #1 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Big Grin PHP 5.3 is here!!!

Time to have a block party!!!
> http://php.net

And take a look at all those new date functions, it's about time!
> http://us2.php.net/manual/en/migration53.functions.php
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 06-30-2009, 03:00 PM   #2 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,053
Thanks: 115
Tanax is on a distinguished road
Default

http://se.php.net/manual/en/functions.anonymous.php

Hurray! That is awesome ^_^
__________________
Tanax is offline  
Reply With Quote
Old 06-30-2009, 03:08 PM   #3 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,215
Thanks: 90
Wildhoney is on a distinguished road
Default

That's my favourite addition to 5.3 !
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 06-30-2009, 03:18 PM   #4 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

Anonymous functions are epic.

PHP Code:
$message = function()
{
  echo 
'Hello, PHP 5.3!';
};

$message(); 
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 06-30-2009, 03:49 PM   #5 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,216
Thanks: 17
Village Idiot is on a distinguished road
Default

I don't see the point in anonymous functions. Could someone enlighten me to how they are an improvement?
Village Idiot is offline  
Reply With Quote
Old 06-30-2009, 04:06 PM   #6 (permalink)
The Contributor
 
cecilia's Avatar
 
Join Date: May 2009
Location: LA, CA
Posts: 93
Thanks: 0
cecilia is on a distinguished road
Default

I wonder when we'll get this version. I like the way the list looks, the MySQL, Array and Date primarily.

As for anonymous, will this run?

$x = 'message()';
${$x};

OR

$x = 'message';
${$x}();
cecilia is offline  
Reply With Quote
Old 06-30-2009, 04:36 PM   #7 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 322
Thanks: 2
Enfernikus is on a distinguished road
Default

Quote:
Originally Posted by Village Idiot View Post
I don't see the point in anonymous functions. Could someone enlighten me to how they are an improvement?
Think array_map
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Old 06-30-2009, 04:44 PM   #8 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,239
Thanks: 3
Salathe is on a distinguished road
Default

Quote:
Originally Posted by Village Idiot View Post
I don't see the point in anonymous functions. Could someone enlighten me to how they are an improvement?
I can't think of a situation where an anonymous function would be required which cannot be done any other way, so it'll certainly be possibly to continue life without ever using an anonymous PHP function.

However, I see the three following scripts and prefer the new anonymous function one. It's a silly example script but I think it gets the point across.

PHP Code:
$subject     'Hello, world!';
$pattern     '/\bworld\b/i';
$replacement 'Salathe';

/*
    Regular, boring function
*/
function mycallback($match)
{
    
// Do some complicated stuff
    
return $GLOBALS['replacement'];
}
echo 
preg_replace_callback($pattern'mycallback'$subject);

/*
    Anonymous function via create_function
*/
echo preg_replace_callback($patterncreate_function('$match''
    // Do some complicated stuff
    return $GLOBALS["replacement"];
'
), $subject);

/*
    Anonymous function
*/
$callback = function($match) use ($replacement)
{
    
// Do some complicated stuff
    
return $replacement;
};
echo 
preg_replace_callback($pattern$callback$subject); 
__________________
salathe@php.net
Salathe is offline  
Reply With Quote
Old 06-30-2009, 05:01 PM   #9 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

If you ever used javascript to a large extent you would get the idea. Just think jQuery.

Code:
$('#element').click(function(){
  // Do something
});
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 06-30-2009, 05:34 PM   #10 (permalink)
The Frequenter
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 440
Thanks: 3
xenon is on a distinguished road
Default

this is also another nifty addition, I think :)
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Old 07-01-2009, 12:42 AM   #11 (permalink)
The Frequenter
 
knight13's Avatar
 
Join Date: Jun 2009
Location: Cleveland,Ohio
Posts: 430
Thanks: 30
knight13 is on a distinguished road
Default

I know this may be a stupid question but is this upgrade to php something that will halt my learning process or have they just added small features that i do not really have to worry about right now?
__________________
Anyone who has never made a mistake has never tried anything new.
~ Albert Einstein ~
knight13 is offline  
Reply With Quote
Old 07-01-2009, 12:50 AM   #12 (permalink)
The Addict
 
adamdecaf's Avatar
 
Join Date: May 2009
Posts: 309
Thanks: 5
adamdecaf is on a distinguished road
Default

Quote:
Originally Posted by knight13 View Post
I know this may be a stupid question but is this upgrade to php something that will halt my learning process or have they just added small features that i do not really have to worry about right now?
It's an update, they have added a bunch of new things and taken out a few things. It should not alter your learning curve if you are still on the opening section.
__________________
My Site
adamdecaf is offline  
Reply With Quote
Old 07-01-2009, 02:01 AM   #13 (permalink)
The Frequenter
 
knight13's Avatar
 
Join Date: Jun 2009
Location: Cleveland,Ohio
Posts: 430
Thanks: 30
knight13 is on a distinguished road
Default

Thanks adamdecaf ~~ I was just making sure.

Will the next php version be 6.0?
__________________
Anyone who has never made a mistake has never tried anything new.
~ Albert Einstein ~
knight13 is offline  
Reply With Quote
Old 07-01-2009, 02:48 AM   #14 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

The next version will probably be 5.4, but that's just a safe guess
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 07-02-2009, 03:12 PM   #15 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 353
Thanks: 8
Kalle is on a distinguished road
Default

PHP 6.0 is planned to be released as next major updated, and after 6.0 its been suggested to develop a 5.4 release to ease the upgrade to PHP 6.0 in the end, whilst thats a good idea for the user, i dont see a reason to develop a 5.4 because hosts will rather upgrade to a 5.4 than a new major.
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Old 07-02-2009, 03:50 PM   #16 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 322
Thanks: 2
Enfernikus is on a distinguished road
Default

Kalle, you wouldn't happen to know where to get a complete list of features, upgrades, and bug fixes to php6 would you? I can't find one.
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Old 07-02-2009, 05:21 PM   #17 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 353
Thanks: 8
Kalle is on a distinguished road
Default

Quote:
Originally Posted by Enfernikus View Post
Kalle, you wouldn't happen to know where to get a complete list of features, upgrades, and bug fixes to php6 would you? I can't find one.
Sure, the current list of completed items are in the NEWS file in the cvs repo:
http://cvs.php.net/viewvc.cgi/php-src/NEWS?view=markup
(I actually had the joy of removing define_syslog_variables from PHP6 =))

For a list of features we plan to put into php6 as of our last PDM (PHP Developers Meeting) summit can be found here:
http://wiki.php.net/summits/pdmnotesmay09

Currently theres some ideas about putting type hinting into PHP6 aswell, but well who knows, nothing is final yet :)
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Old 07-02-2009, 10:56 PM   #18 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

So what is the point of releasing 5.4 after 6.0??
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 07-02-2009, 11:03 PM   #19 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 353
Thanks: 8
Kalle is on a distinguished road
Default

Absolutely non if you ask me
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Old 07-03-2009, 12:19 AM   #20 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

I second that
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
10 PHP Myths Dispelled Wildhoney General 10 06-15-2009 06:55 AM
Can't get PHP 5. to work? Newbie windows PHP guy DotNetTim Absolute Beginners 6 02-07-2009 09:25 AM
PHP Compressor Kalle Script Giveaway 8 05-28-2008 12:14 AM
what are all the subjects in php? sarmenhb General 7 01-21-2008 04:41 PM
Uploading Files with PHP daz Absolute Beginners 3 09-30-2007 06:23 PM


All times are GMT. The time now is 01:15 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design