Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Dave Ingram
Fact: Adding a new name for a special kind of function as a syntax construct is going to cost (possibly unnecessary) time and energy, because now you have functions, and weird things that look almost like functions but aren't and can only be used to make generators. Just to put my oar in too, a

Re: [PHP-DEV] mb_string.func_overload has secretly been changed from PERDIR to SYSTEM

2009-09-10 Thread Dave Ingram
Tony Marston wrote: > There is no set_up_language() function, and what has SquirrelMail got to do > with PHP? > > Unless you can point to some official documentation on the PHP web site your > "advice" is totally unsubstantiated and virtually worthless. > He was referring to set_up_language()

Re: [PHP-DEV] mb_string.func_overload has secretly been changed from PERDIR to SYSTEM

2009-09-10 Thread Dave Ingram
Tony Marston wrote: > There is no set_up_language() function, and what has SquirrelMail got to do > with PHP? > > Unless you can point to some official documentation on the PHP web site your > "advice" is totally unsubstantiated and virtually worthless. > > As for hints in the documentation, s

Re: [PHP-DEV] About optimization

2010-01-13 Thread Dave Ingram
mathieu.suen wrote: Sebastian Bergmann wrote: Am 13.01.2010 12:18, schrieb mathieu.suen: Because any optimization, even very simple ones, impose a performance penalty in the default execution model of PHP which does not use a bytecode cache. For simple optimization I don't think so.

Re: [PHP-DEV] Dots and spaces in variable names are converted to underscores.

2010-01-21 Thread Dave Ingram
Richard Lynch wrote: > For BC, I suppose PHP could have *both* 'a.b' and 'a_b' +1 as a PHP user. For BC, I guess this should go without changing the current precedence rules too, annoying though it might be. At the moment: "?a_b=foo&a.b=bar" gives $_GET === array('a_b' => 'bar') As I understand it

Re: [PHP-DEV] Type hinting

2010-05-26 Thread Dave Ingram
On 05/25/10 13:05, Thomas Nunninger wrote: > - If you don't want to distinguish beetween strict and weak hints, create > some > ini setting that influences the behavior. (I'm not a fan of that.) > My £0.02 as a user: ini settings should NEVER influence the way the core language works, as they

Re: [PHP-DEV] inheritance check too strict?

2010-08-19 Thread Dave Ingram
On 19/08/10 08:51, Stas Malyshev wrote: > Hi! > > I recently noticed this code: > > error_reporting(E_ALL | E_STRICT); > > class ObjParent { > public function set($param2 = ''){ } > } > > class ObjChild extends ObjParent { > public function set(){ } > } > > produces a E_STRICT warning

Re: [PHP-DEV] inheritance check too strict?

2010-08-19 Thread Dave Ingram
On 19/08/10 09:13, Stas Malyshev wrote: > Hi! > >> I was under the impression that, in order for inheritance to provide >> proper polymorphism, overridden methods should share the parent's method >> signature, although they can have additional optional arguments. > > Your impression is wrong. Over

Re: [PHP-DEV] build sapi's separately

2010-10-15 Thread Dave Ingram
On 10/14/10 12:04, Enrico Weigelt wrote: > is it already possible to build the sapi modules separately ? > I'd like to split them off into completely separate packages > for easier systems maintenance. Various distros already do this. See for example the Red Hat PHP RPM. It depends which packagin

Re: [PHP-DEV] PHP 5.4 - Meta attribute (aka. Annotations) supportdiscussion

2010-11-16 Thread Dave Ingram
On 16/11/10 21:56, Alec wrote: > [snip] > > attribute RestMethod('/do/something', 'Do Stuff', 'Does something.', > array( > 'arg1' => 'A cool argument!' > )); > public static DoSomething($arg1) { > ... > > or > > attribute Example('arg', 'arg2', 3, (time() > 0 ? true : false)); > class Demo {

Re: [PHP-DEV] PHP 5.4 - Meta attribute (aka. Annotations) supportdiscussion

2010-11-16 Thread Dave Ingram
On 17/11/10 06:38, Will Fitch wrote: > I like the idea, Alec. > > My only question is, syntactically, what difference would using a keyword, > in this case "attribute", as opposed to brackets "[]"? I would say that it provides better searchability -- it's easier for people new to the feature to re

Re: [PHP-DEV] Project Management

2010-12-01 Thread Dave Ingram
On 01/12/10 10:13, Lester Caine wrote: > See other post as well > > Nathan Nobbe wrote: > >> git archive cranks out a single file representing any commit in the >> repository, it can even format the archive w/ zip for the windows >> folks ;) > YES but without any header updates to the files. > Onc

Re: [PHP-DEV] Project Management

2010-12-01 Thread Dave Ingram
On 12/01/10 12:21, Lester Caine wrote: > Dave Ingram wrote: >>>> git archive cranks out a single file representing any commit in the >>>> repository, it can even format the archive w/ zip for the windows >>>> folks ;) >>> YES but without any header

Re: [PHP-DEV] preg_replace does not replace all occurrences

2011-03-15 Thread Dave Ingram
On 03/15/11 12:41, Ben Schmidt wrote: > [snip] > > Hope this helps, > > Ben. As an outsider in this discussion, I'd just like to applaud you for one of the best, in-depth, most patient and most thorough explanations I have ever seen on a mailing list. Dave -- PHP Internals - PHP Runtime Develo

Re: [PHP-DEV] RFC: built-in web server in CLI.

2011-04-20 Thread Dave Ingram
On 04/19/11 15:44, Michael Morris wrote: > watch ($var) -> $var is sent to the console on the line this statement is > made with the statment "now watching 'var'.. init value "x", and then each > time it changes it is updated in the console. Just my 0.02 as a user, but it strikes me that watch() co

Re: [PHP-DEV] Variable scopes for language constructs (foreach, ...)

2011-06-28 Thread Dave Ingram
On 06/23/11 21:48, John Crenshaw wrote: >> I think proposed change is extremely counter intuitive to the design >> of PHP in regard to scoping and would be a very large bc break, PHP is >> doing exactly what it is suppose to do here and I wouldn't want it any >> other way. > Agreed. Although I gene

Re: [PHP-DEV] json_encode ignores protected/private class members

2008-10-09 Thread Dave Ingram
I still don't see why json_encode ignores protected/private class members. I mean, why we need this feature. >>> >>> Because, in theory, it shouldn't even be able to see those members? >> >> Stefan's right. Unless you are in the local scope or inheriting the >> object you shouldn't be a

Re: [PHP-DEV] json_encode ignores protected/private class members

2008-10-09 Thread Dave Ingram
>> however changing this at this point would be a huge security issue, so >> if at all, it would need to be handled by an optional parameter that >> defaults to false. >> > > That would be unclean. If it's implemented in some way, json_encode should > look for the implementation of some inte

Re: [PHP-DEV] json_encode ignores protected/private class members

2008-10-09 Thread Dave Ingram
Ron Rademaker wrote: > Stefan Walk wrote: >> That would be unclean. If it's implemented in some way, json_encode >> should look for the implementation of some interface (JSONEncodable >> or something) providing encoding/decoding methods (similar to >> __sleep/__wakeup). > Looking at our current JSO

Re: [PHP-DEV] alpha2 scheduled

2008-10-28 Thread Dave Ingram
marius popa wrote: > an semisolution would be an php.ini variable > like > NAMSPACE_SEPARATOR="::" > so if you have an issue with your classes can be reset to "\" or > whatever with ini_set > > i think it's easy to be done if i look at the patch that created the > backslash separator issue > So

Re: [PHP-DEV] alpha2 scheduled

2008-10-28 Thread Dave Ingram
Dave Ingram wrote: > marius popa wrote: > >> an semisolution would be an php.ini variable >> like >> NAMSPACE_SEPARATOR="::" >> so if you have an issue with your classes can be reset to "\" or >> whatever with ini_set >> >> i

Re: [PHP-DEV] Constants in double-quoted strings

2008-10-29 Thread Dave Ingram
> I only worry it could break BC - people might have used "{SOMETEXT}" in > strings and not expect it to be interpolated (I've done so myself). > I've done that a lot, and I've seen quite a bit of templating code that does the same. My personal opinion is that interpolating constants would ju

Re: [PHP-DEV] Constants in double-quoted strings

2008-10-29 Thread Dave Ingram
Josh wrote: > Dave, how is a variable name any less a bareword than a constant name? > A bareword (in my opinion) is a word without a sigil (e.g. a leading $), so the way that you would write a constant normally in PHP. What I was trying to say is that having bareword-style interpolation ("{MYCO

Re: [PHP-DEV] Re: Case sensitivity

2008-11-07 Thread Dave Ingram
educe the number of possibilities available: $foo++; echo $ofo; if ($oof > 4) break; I am now very tempted to write something that does this. I can think of a fairly easy and not-hugely-intensive implementation, too. I'd imagine the canonical form for each variable would be an anagram dicti

Re: [PHP-DEV] Q on Primitives

2008-12-18 Thread Dave Ingram
Nathan Rixham wrote: > [...] > > while I'm here I may as well also ask about further adding type > hinting for the existing scalars and array. +1, but I don't know what might have stopped it being implemented before (time, parsing API changes, etc), so it would be interesting to look into the histo

Re: [PHP-DEV] Q on Primitives

2008-12-18 Thread Dave Ingram
> I remember that multiple signatures was said to have a possible very > difficult implementation. However, a similar behaviour can be achieved by > some instanceof(). > I thought it probably would be awkward, but we do already have some type hinting that can also be accomplished with instanceo

Re: [PHP-DEV] Q on Primitives

2008-12-18 Thread Dave Ingram
Cristian Rodríguez wrote: >> class MyTestClass { >> public function blah(Foo $f); >> public function blah(Bar $b); >> public function blah($v); >> } >> > > Looks like you are using the wrong language, you need JAVA instead. > Yes, I'll admit it does look like Java (or any C++-like OO