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

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

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 ww.ga...@gmail.com 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.

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 kris.cr...@gmail.com wrote: On Thu, Apr 12, 2012 at 8:24 PM, John LeSueur john.lesu...@gmail.comwrote: On Thu, Apr 12, 2012 at 9:00 PM, Kris Craig kris.cr...@gmail.com wrote: On Thu, Apr 12, 2012 at 7:51 PM, John LeSueur

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 exactly once,

[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 of

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 paul.kony...@gmail.com 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

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 nikita@googlemail.com wrote: On Fri, Apr 13, 2012 at 11:37 AM, Pal Konyves paul.kony...@gmail.com 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

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 davidkm...@gmail.com 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,

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 kris.cr...@gmail.com wrote: On Thu, Apr 12, 2012 at 8:24 PM, John LeSueur john.lesu...@gmail.com 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

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

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] '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 number:

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 it

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 paul.kony...@gmail.com 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

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 weierophin...@php.net wrote: On 2012-04-13, David Muir davidkm...@gmail.com wrote: On 13/04/12 14:55, Stas Malyshev wrote: If this is a

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,

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 davidkm...@gmail.com 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

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 arvids.godj...@gmail.comwrote: 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

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 l...@cywh.com 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

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 nicolas.grekas+...@gmail.com 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 () {

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] '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] 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:

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 kris.cr...@gmail.com wrote: On Thu, Apr 12, 2012 at 8:24 PM, John LeSueur john.lesu...@gmail.com wrote: //a controller, maybe a class, maybe just a set of functions, but in a

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-internalsm=130348253124215w=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] Re: Disabling PHP tags by php.ini and CLI options

2012-04-13 Thread Matthew Weier O'Phinney
On 2012-04-13, Tom Boutell t...@punkave.com 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

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 that's

[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

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 dsnytk...@ultralogistics.com 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

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:

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 dsnytk...@ultralogistics.com 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

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 always

[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

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 johncrens...@priacta.comwrote: 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

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

2012-04-13 Thread Gustavo Lopes
On Fri, 13 Apr 2012 18:09:24 +0200, Stas Malyshev smalys...@sugarcrm.com 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

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 nicolas.grekas+...@gmail.com 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

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 kris.cr...@gmail.com wrote: --f46d04447f47ae95ec04bd949e5f Content-Type: text/plain; charset=ISO-8859-1 On Fri, Apr 13, 2012 at 12:12 PM, John Crenshaw johncrens...@priacta.com wrote: On top of this, there's an argument that you're not addressing: most

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

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 kris.cr...@gmail.com wrote: --f46d04447f47ae95ec04bd949e5f Content-Type: text/plain; charset=ISO-8859-1 On Fri, Apr 13, 2012 at 12:12 PM, John Crenshaw

[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

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 to

[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

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

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 weierophin...@php.net: On 2012-04-13, Tom Boutell t...@punkave.com 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

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 yohg...@ohgaki.net: Hi, 2012/4/14 Matthew Weier O'Phinney weierophin...@php.net: On 2012-04-13, Tom Boutell t...@punkave.com wrote: Wouldn't this be a significant performance hit when multiplied by every class file in a project? Typically, you'd cache the

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

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