Re: [PHP-DEV] Re: solving most git issues and questions

2012-04-13 Thread Alan Knowles
Saw this mentioned on one of the blogs comments today. http://nuclearsquid.com/writings/git-new-workdir/ It may be an easier to use for those working with multiple branches of PHP, and enjoy the multiple directory for each branch approach.. (aka old svn..) Regards Alan On Friday, April 13,

Re: [PHP-DEV] Ability to assign new object to a class property.

2012-04-13 Thread Stas Malyshev
Hi! > Just throwing this out there, but that code wouldn't be run on parse. > It would be "queued" to run prior to the constructor on instantiation. Why? You have perfectly good ctor, why not use it? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext.

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Stas Malyshev
Hi! > What's proposed is really more closely related to the functionality of > "global" since you're taking a non-local variable and making it accessible. It is like global but with important difference - global inserts the variable into current scope, with all consequences (modification, etc.).

Re: [PHP-DEV] Re: Disabling PHP tags by php.ini and CLI options

2012-04-13 Thread Yasuo Ohgaki
Hi, 2012/4/14 Yasuo Ohgaki : > Hi, > > 2012/4/14 Matthew Weier O'Phinney : >> On 2012-04-13, Tom Boutell wrote: >>> Wouldn't this be a significant performance hit when multiplied by >>> every class file in a project? >> >> Typically, you'd cache the end-result of pre-processing, so that >> subseq

Re: [PHP-DEV] Re: Disabling PHP tags by php.ini and CLI options

2012-04-13 Thread Yasuo Ohgaki
Hi, 2012/4/14 Matthew Weier O'Phinney : > On 2012-04-13, Tom Boutell wrote: >> Wouldn't this be a significant performance hit when multiplied by >> every class file in a project? > > Typically, you'd cache the end-result of pre-processing, so that > subsequent requests can use the processed resul

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Ralph Schindler
I too am on the fence, but lean more towards not liking it. Here's why: I'm on the fence about "use ((expression) as $foo)" -- I fully like the idea of aliasing closure variables, but still thinking on the expression syntax. It would be _inconsistent_ with how it works with namespaces (which us

[PHP-DEV] PHP 5.3.11RC2 Released for Testing

2012-04-13 Thread Johannes Schlüter
(Sorry if you receive this 5.3.11 related message two times) Hi, The second, and hopefully last, release candidate for 5.3.11 was released for testing and can be downloaded here: http://downloads.php.net/johannes/php-5.3.11RC2.tar.bz2 http://downloads.php.net/johannes/php-5.3.11RC2.tar.g

Re: [PHP-DEV] Ability to assign new object to a class property.

2012-04-13 Thread Anthony Ferrara
Stas, > Because the engine doesn't run code when parsing class definitions so > defaults should be constants (otherwise would also create a lot of > trouble for bytecode caching as object are not cacheable). Just throwing this out there, but that code wouldn't be run on parse. It would be "queued

[PHP-DEV] Outdated Central Repos == Security Vulerabilities, New Study Finds

2012-04-13 Thread Kris Craig
http://www.esecurityplanet.com/open-source-security/study-warns-of-security-flaws-in-open-source-components.html This is EXACTLY why the prevailing mindset about central repositories needs to change! Keeping it at PHP 5.1 doesn't provide more "stable" and "reliable" code. It just keeps it vulne

Re: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts

2012-04-13 Thread Kris Craig
On Fri, Apr 13, 2012 at 1:02 PM, Matthew Weier O'Phinney < weierophin...@php.net> wrote: > On 2012-04-13, Kris Craig wrote: > > --f46d04447f47ae95ec04bd949e5f > > Content-Type: text/plain; charset=ISO-8859-1 > > > > On Fri, Apr 13, 2012 at 12:12 PM, John Crenshaw < > johncrens...@priacta.com> wro

Re: [PHP-DEV] Ability to assign new object to a class property.

2012-04-13 Thread Stas Malyshev
Hi! > Why can't we create a new object and assign it to property like this? Because the engine doesn't run code when parsing class definitions so defaults should be constants (otherwise would also create a lot of trouble for bytecode caching as object are not cacheable). Use ctor for complex ini

Re: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts

2012-04-13 Thread Matthew Weier O'Phinney
On 2012-04-13, Kris Craig wrote: > --f46d04447f47ae95ec04bd949e5f > Content-Type: text/plain; charset=ISO-8859-1 > > On Fri, Apr 13, 2012 at 12:12 PM, John Crenshaw > wrote: > > > > > > > > > On top of this, there's an argument that you're not addressing: most > > > > template engines in PHP eit

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Matthew Weier O'Phinney
On 2012-04-13, Nicolas Grekas wrote: > > Yes, the original used "$this->getFooBar()" -- but it could have been > > "$someOtherObject->getFooBar()" > > Yep, you and Anthony are right, my comment was stupid... > > Then I have an other objection :) > > I'm not comfortable with mixing declarative line

Re: [PHP-DEV] '9223372036854775807' == '9223372036854775808'

2012-04-13 Thread Gustavo Lopes
On Fri, 13 Apr 2012 18:09:24 +0200, Stas Malyshev wrote: There are other situations where the result of the comparison may be "inaccurate" -- in the sense that two strings may be constructed as representing different numbers, but they compare equal. * Comparing two different real numbers tha

Re: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts

2012-04-13 Thread Kris Craig
On Fri, Apr 13, 2012 at 12:12 PM, John Crenshaw wrote: > > > > > > On top of this, there's an argument that you're not addressing: most > > > template engines in PHP either directly consume PHP template files... > > > or "compile" templates into... PHP template files. As such, sooner or > > > late

[PHP-DEV] Upcoming Outage: php.net

2012-04-13 Thread Daniel Brown
Greetings, all; This coming Monday, 16 April, 2012, between the hours of 18:00 and 20:00 EDT (22:00 to 00:00 GMT), the one of the primary php.net servers will be undergoing a critical preventative maintenance operation. In this two-hour maintenance window, we do expect a period of interru

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Nicolas Grekas
> Yes, the original used "$this->getFooBar()" -- but it could have been > "$someOtherObject->getFooBar()" Yep, you and Anthony are right, my comment was stupid... Then I have an other objection :) I'm not comfortable with mixing declarative lines with expressions: function (..) use (..) is alwa

Re: [PHP-DEV] Ability to assign new object to a class property.

2012-04-13 Thread Etienne Kneuss
On Fri, Apr 13, 2012 at 21:29, Dmitri Snytkine wrote: > But why is it possible to assing  a new array to a property like that but not > a new instance of some class? > Isn't a new array also requires some type of initialization? Only static values are allowed, which means that the value requires

RE: [PHP-DEV] Ability to assign new object to a class property.

2012-04-13 Thread Dmitri Snytkine
But why is it possible to assing a new array to a property like that but not a new instance of some class? Isn't a new array also requires some type of initialization? Dmitri Snytkine Web Developer Ultra Logistics, Inc. Phone: (888) 220-4640 x 2097 Fax: (888) 795-6642 E-Mail: dsnytk...@ultralogi

Re: [PHP-DEV] Ability to assign new object to a class property.

2012-04-13 Thread Etienne Kneuss
Hi, On Fri, Apr 13, 2012 at 21:19, Dmitri Snytkine wrote: > I always wondered why can't we do something like this in php > > class MyClass{ > > private $storage = new ArrayObject(); > > public function __construct($v){ > // whatever > } > > // rest of class > > } > > Why can't we create a new obj

[PHP-DEV] Ability to assign new object to a class property.

2012-04-13 Thread Dmitri Snytkine
I always wondered why can't we do something like this in php class MyClass{ private $storage = new ArrayObject(); public function __construct($v){ // whatever } // rest of class } Why can't we create a new object and assign it to property like this? Then when a new instance of MyClass is cr

RE: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts

2012-04-13 Thread John Crenshaw
> > > > On top of this, there's an argument that you're not addressing: most > > template engines in PHP either directly consume PHP template files... > > or "compile" templates into... PHP template files. As such, sooner or > > later, you'll have a class that includes a PHP template file, and >

Re: [PHP-DEV] Re: Disabling PHP tags by php.ini and CLI options

2012-04-13 Thread Matthew Weier O'Phinney
On 2012-04-13, Tom Boutell wrote: > Wouldn't this be a significant performance hit when multiplied by > every class file in a project? Typically, you'd cache the end-result of pre-processing, so that subsequent requests can use the processed results. In other words, you incur the expense once per

Re: [PHP-DEV] '9223372036854775807' == '9223372036854775808'

2012-04-13 Thread Stas Malyshev
Hi! > Sadly when I proposed this many months ago my post was ignored. :-( I've looked up your post (http://marc.info/?l=php-internals&m=130348253124215&w=2 if anybody's interested) and unfortunately I think it did not have due attention because it mixed two issues - converting comparison that ==

Re: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts

2012-04-13 Thread Kris Craig
On Fri, Apr 13, 2012 at 7:15 AM, Matthew Weier O'Phinney < weierophin...@php.net> wrote: > On 2012-04-13, Kris Craig wrote: > > On Thu, Apr 12, 2012 at 8:24 PM, John LeSueur > wrote: > > > //a controller, maybe a class, maybe just a set of functions, but in a > > > .phpp file > > > function getL

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Christopher Jones
On 04/13/2012 08:49 AM, Stas Malyshev wrote: At now this is there should not alter of course. What really needed is 'named parameters' That's entirely different topic. https://wiki.php.net/rfc/namedparameters -- Email: christopher.jo...@oracle.com Tel: +1 650 506 8630 Blog: http://blog

Re: [PHP-DEV] '9223372036854775807' == '9223372036854775808'

2012-04-13 Thread Matt Pelmear
On 04/13/2012 09:12 AM, Rasmus Lerdorf wrote: On 04/13/2012 09:09 AM, Stas Malyshev wrote: However I think it would make sense not to use this conversion in string comparisons when we know it's lossy - it seems to be outside of the use case for such comparisons and it seems apparent by now that

Re: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts

2012-04-13 Thread Kris Craig
On Fri, Apr 13, 2012 at 5:45 AM, John LeSueur wrote: > > > On Thu, Apr 12, 2012 at 11:13 PM, Kris Craig wrote: > >> >> >> On Thu, Apr 12, 2012 at 8:24 PM, John LeSueur wrote: >> >>> >>> On Thu, Apr 12, 2012 at 9:00 PM, Kris Craig wrote: >>> On Thu, Apr 12, 2012 at 7:51 PM, John LeS

Re: [PHP-DEV] A possible defining characteristic of PHP 6 ( was [off] PHP: a fractal of bad design )

2012-04-13 Thread Stas Malyshev
Hi! > PHP's goal has always been KISS, but the decisions over the last few > years run contrary to that. Most onerous is, where Javascript, Java > and C have one scope resolution operator - a period - PHP has three > (->, \, :: ). The only possible backwards compat fix to that is to This is not

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Matthew Weier O'Phinney
On 2012-04-13, Nicolas Grekas wrote: > --f46d04016a77a386cf04bd8a62df > Content-Type: text/plain; charset=ISO-8859-1 > > > $closure = function () use ($this->getFooBar() as $foo) { > > $foo->stuff(); > > } > > But this can already be written as : > > $closure = function () { > $foo = $thi

Re: [PHP-DEV] A possible defining characteristic of PHP 6 ( was [off] PHP: a fractal of bad design )

2012-04-13 Thread Michael Morris
On Wed, Apr 11, 2012 at 11:19 AM, Luke Scott wrote: > I do agree with a lot of what was being said. But what can you do? It would not be easy. I lack the skills required. And those who have the skills lack the monumental time required. But PHP could do what Adobe did with Actionscript. But it

Re: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts

2012-04-13 Thread Kris Craig
On Fri, Apr 13, 2012 at 1:00 AM, Arvids Godjuks wrote: > Kris. > > I can give you a real world example where that straight MVC with the. pphp > if not breaks, then definetly becomes an ugly mess. > I use Yii framework as my tool, it has some very nice tools for templating > like widgets. Widgets p

Re: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts

2012-04-13 Thread Kris Craig
On Thu, Apr 12, 2012 at 11:37 PM, David Muir wrote: > On 13/04/12 15:13, Kris Craig wrote: > > Again, the controller should NOT be a .phpp file. Likewise, your model > > should NOT be hooking directly to the view. The controller hooks to the > > model. The controller then sanitizes that and re

Re: [PHP-DEV] Re: Disabling PHP tags by php.ini and CLI options

2012-04-13 Thread Tom Boutell
(I'm referring to the streams approach. You seem to be suggesting a PECL extension with a fallback provision. It still sounds like something no one will seriously use because they can't count on it running fast on a given box, although it is a clever workaround.) On Fri, Apr 13, 2012 at 1:28 PM, T

Re: [PHP-DEV] Re: Disabling PHP tags by php.ini and CLI options

2012-04-13 Thread Tom Boutell
Wouldn't this be a significant performance hit when multiplied by every class file in a project? On Fri, Apr 13, 2012 at 10:15 AM, Matthew Weier O'Phinney wrote: > On 2012-04-13, David Muir wrote: >> On 13/04/12 14:55, Stas Malyshev wrote: >> > > If this is a pecl module library developers canno

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-04-13 Thread Etienne Kneuss
On Fri, Apr 13, 2012 at 16:22, Pal Konyves wrote: > Well, if you want to use empty in the above mentioned situations, you might > need the change. I personally don't like using empty(). I use it only on > arrays, that's because semantically fits: array is empty. > > In other situations I prefer co

Re: [PHP-DEV] '9223372036854775807' == '9223372036854775808'

2012-04-13 Thread Rasmus Lerdorf
On 04/13/2012 09:09 AM, Stas Malyshev wrote: > However I think it would make sense not to use this conversion in string > comparisons when we know it's lossy - it seems to be outside of the use > case for such comparisons and it seems apparent by now that it is hard > for people to understand why i

Re: [PHP-DEV] '9223372036854775807' == '9223372036854775808'

2012-04-13 Thread Stas Malyshev
Hi! > There are other situations where the result of the comparison may be > "inaccurate" -- in the sense that two strings may be constructed as > representing different numbers, but they compare equal. > > * Comparing two different real numbers that map to the same double > precision numbe

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Stas Malyshev
Hi! > I am not sure but it is too expensive only for memory. I don't think > that current scope will be very big and operation for copying it very That depends on the scope, it can be very big - e.g. global scope. But more important is not that it is big by itself, but that it retains variables

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-04-13 Thread Pal Konyves
Well, if you want to use empty in the above mentioned situations, you might need the change. I personally don't like using empty(). I use it only on arrays, that's because semantically fits: array is empty. In other situations I prefer comparing against the according return type because it improve

Re: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts

2012-04-13 Thread Matthew Weier O'Phinney
On 2012-04-13, Kris Craig wrote: > On Thu, Apr 12, 2012 at 8:24 PM, John LeSueur wrote: > > //a controller, maybe a class, maybe just a set of functions, but in a > > .phpp file > > function getLoginPage() > > { > > //set up some data > > //some people like to use plain .php for templates

Re: [PHP-DEV] Re: Disabling PHP tags by php.ini and CLI options

2012-04-13 Thread Matthew Weier O'Phinney
On 2012-04-13, David Muir wrote: > On 13/04/12 14:55, Stas Malyshev wrote: > > > If this is a pecl module library developers cannot use it and trust > > > that on php 5.n, it just works. That would fork the language in an > > > undesirable way. It should be a core feature, no ini flag, no > > > so

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-04-13 Thread Etienne Kneuss
Hi, On Fri, Apr 13, 2012 at 15:00, Nikita Popov wrote: > On Fri, Apr 13, 2012 at 11:37 AM, Pal Konyves wrote: >> I don't see the point of empty( function() ). >> >> You tipically use empty on values that holds information you want to use >> later in the program flow (a string, an integer). That

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-04-13 Thread Nikita Popov
On Fri, Apr 13, 2012 at 11:37 AM, Pal Konyves wrote: > I don't see the point of empty( function() ). > > You tipically use empty on values that holds information you want to use > later in the program flow (a string, an integer). That means you'd better > extract it to a variable because you want

[PHP-DEV] Re: solving most git issues and questions

2012-04-13 Thread David Soria Parra
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > Please add all your questions here: > > https://wiki.php.net/vcs/gitfaq-usecases > > And let try to answer them one by one, for the best or recommended > way to do something. Thank you. makes sense to put it into the wiki and discuss it :). First

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Anthony Ferrara
Nicolas >> $closure = function () use ($this->getFooBar() as $foo) { >>     $foo->stuff(); >> } > > But this can already be written as : > >  $closure = function () { >    $foo = $this->getFooBar(); >    $foo->stuff(); > } Except that's not equivilant. getFooBar() in the first example is called

Re: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts

2012-04-13 Thread John LeSueur
On Thu, Apr 12, 2012 at 11:13 PM, Kris Craig wrote: > > > On Thu, Apr 12, 2012 at 8:24 PM, John LeSueur wrote: > >> >> On Thu, Apr 12, 2012 at 9:00 PM, Kris Craig wrote: >> >>> >>> >>> On Thu, Apr 12, 2012 at 7:51 PM, John LeSueur wrote: >>> On Thu, Apr 12, 2012 at 7:49 PM, Kris C

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Nikita Popov
On Fri, Apr 13, 2012 at 2:02 AM, Xinchen Hui wrote: > This $this is not that $this , plz thinking : >       $closuer->bindTo > > And $this become the new scope, but the alias still refer to the obj > who own this closure. That makes sense. Thanks. -- PHP Internals - PHP Runtime Development Mailin

Re: [PHP-DEV] [RFC] Allow non-variable arguments to empty() and isset()

2012-04-13 Thread Nikita Popov
On Fri, Apr 13, 2012 at 12:42 AM, Galen Wright-Watson wrote: > Just to be clear, under the new behavior, calling "empty" or "isset" on > undefined variables and undefined array indices shouldn't produce a notice > when E_NOTICE is set, correct? Basically, the change isn't regressive. Yup, that's r

Re: [PHP-DEV] '9223372036854775807' == '9223372036854775808'

2012-04-13 Thread Gustavo Lopes
On Fri, 13 Apr 2012 11:48:10 +0200, Pierre Joye wrote: On Fri, Apr 13, 2012 at 11:40 AM, marius adrian popa wrote: Something for the weekend (flamewar) http://www.reddit.com/r/programming/comments/s6477/9223372036854775807_9223372036854775808/ http://news.ycombinator.com/item?id=3832069

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Yasuo Ohgaki
Hi, 2012/4/13 Laruence : > On Fri, Apr 13, 2012 at 4:19 PM, Yasuo Ohgaki wrote: >> Hi, >> >> 2012/4/13 Verbitsky Alexander : >>> On 04/12/2012 06:38 PM, Laruence wrote: Hi:      I have made a RFC to allow user use T_AS in the closure declaration, like:      function

[PHP-DEV] PHP 5.4.2RC1 Released for Testing

2012-04-13 Thread David Soria Parra
It's PHP 5.4.1RC2 not RC1 On 2012-04-13, David Soria Parra wrote: > > Hello! > > Stas has packed PHP 5.4.1RC2 which you can find here: > > http://downloads.php.net/stas/ > > The Windows team provides windows binaries which you find here: > > http://windows.php.net/qa/ > > Please ensure th

[PHP-DEV] PHP 5.4.1RC1 Released for Testing

2012-04-13 Thread David Soria Parra
Hello! Stas has packed PHP 5.4.1RC2 which you can find here: http://downloads.php.net/stas/ The Windows team provides windows binaries which you find here: http://windows.php.net/qa/ Please ensure that the release is solid and all things behave as expected! Please test this RC against

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Verbitsky Alexander
On 04/13/2012 11:36 AM, Stas Malyshev wrote: Hi! I'm at a bit of a loss as to why Laruence is claiming that allowing closures to implicitly access variables in the outer scope requires duplicating the symbol table. Because variables need to be stored somewhere after the parent function exits.

Re: [PHP-DEV] '9223372036854775807' == '9223372036854775808'

2012-04-13 Thread Pierre Joye
hi No thanks, but read: https://bugs.php.net/bug.php?id=54547 everything is in there. We don't need more rant posts on this list :) Cheers, On Fri, Apr 13, 2012 at 11:40 AM, marius adrian popa wrote: > Something for the weekend (flamewar) > http://www.reddit.com/r/programming/comments/s6477/

Re: [PHP-DEV] Allow non-variable arguments to empty()

2012-04-13 Thread Pal Konyves
> Hi! > > "The original reason for this restriction probably is that - in a way - > it "doesn't make sense" to pass anything but a variable to empty()" > > I don't see the point of empty( function() ). > > You tipically use empty on values that holds information you want to use > later in the progr

[PHP-DEV] solving most git issues and questions

2012-04-13 Thread Pierre Joye
Hi! As one, I have regular small but annoying issues with git. No big deal or stoppers but they are mostly due to my lack of clue. Following a little bit the questions and discussions on IRC, it seems that we are many in the same situation. That's why I would like to improve the FAQ and the workf

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Laruence
On Fri, Apr 13, 2012 at 4:19 PM, Yasuo Ohgaki wrote: > Hi, > > 2012/4/13 Verbitsky Alexander : >> On 04/12/2012 06:38 PM, Laruence wrote: >>> >>> Hi: >>>      I have made a RFC to allow user use T_AS in the closure declaration, >>> like: >>> >>>      function () use($long as $l,&$long as $r) { >>>

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Stas Malyshev
Hi! > I'm at a bit of a loss as to why Laruence is claiming that allowing > closures to implicitly access variables in the outer scope requires > duplicating the symbol table. Because variables need to be stored somewhere after the parent function exits. > Is there any technical reason why it's

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Yasuo Ohgaki
2012/4/13 Yasuo Ohgaki : > > I would rather have this. > function FUNC($a, $b, $c) uses ($d, $e, $f) {} > Then it would be consistent with anonymous function. Oops. It became consistent, but there would be no use with PHP. As it cannot pollute global vars. -- Yasuo Ohgaki yohg...@ohgaki.net --

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Charlie Somerville
I'm at a bit of a loss as to why Laruence is claiming that allowing closures to implicitly access variables in the outer scope requires duplicating the symbol table. Is there any technical reason why it's not possible for scopes to retain a pointer to their parent scopes so variables can be looked

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Yasuo Ohgaki
Hi, 2012/4/13 Verbitsky Alexander : > On 04/12/2012 06:38 PM, Laruence wrote: >> >> Hi: >>      I have made a RFC to allow user use T_AS in the closure declaration, >> like: >> >>      function () use($long as $l,&$long as $r) { >> >>      } >> >>      here is the RFC: https://wiki.php.net/rfc/use

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Laruence
On Fri, Apr 13, 2012 at 4:10 PM, Verbitsky Alexander wrote: > On 04/12/2012 06:38 PM, Laruence wrote: >> >> Hi: >>      I have made a RFC to allow user use T_AS in the closure declaration, >> like: >> >>      function () use($long as $l,&$long as $r) { >> >>      } >> >>      here is the RFC: http

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Verbitsky Alexander
On 04/12/2012 06:38 PM, Laruence wrote: Hi: I have made a RFC to allow user use T_AS in the closure declaration, like: function () use($long as $l,&$long as $r) { } here is the RFC: https://wiki.php.net/rfc/useas any ideas? thanks Closure is a functional literal

Re: [PHP-DEV] [RFC] New .phpp File Type for Pure-Code PHP Scripts

2012-04-13 Thread Arvids Godjuks
Kris. I can give you a real world example where that straight MVC with the. pphp if not breaks, then definetly becomes an ugly mess. I use Yii framework as my tool, it has some very nice tools for templating like widgets. Widgets provide a container to put functionalit required by multiple pages a

Re: [PHP-DEV] [RFC] Allow "use( $longname as $alias)" syntax for closures declaration

2012-04-13 Thread Nicolas Grekas
> $closure = function () use ($this->getFooBar() as $foo) { > $foo->stuff(); > } But this can already be written as : $closure = function () { $foo = $this->getFooBar(); $foo->stuff(); } Here, $foo also only exists inside the closure. > Also, remember that the closure is in fact an

Re: [PHP-DEV] Re: Disabling PHP tags by php.ini and CLI options

2012-04-13 Thread Ferenc Kovacs
"lol ... really REALLY stupid" ps: I got baited 2012.04.13. 2:08, "Kris Craig" ezt írta: > On Thu, Apr 12, 2012 at 5:02 PM, Arvids Godjuks >wrote: > > > You all know where the short_tags, register_globals, magic_quotes and > other > > stuff like that took the language and the problems it made.