Re: [PHP-DEV] Tree sort in C

2007-05-09 Thread Michael Walter
Hi, A quick sketch of an idea that should work: 1, 'parent_id'=>0), array('id'=>2, 'parent_id'=>1), array('id'=>3, 'parent_id'=>1), array('id'=>4, 'parent_id'=>2) ); // create column data $keys=$indents=$index=array(); $i=0; foreach($nodes as $node) { $id=$node['id']; $pid=

Re: [PHP-DEV] PATCH: anonymous functions in PHP

2007-03-22 Thread Michael Walter
On 3/22/07, Sean Coates <[EMAIL PROTECTED]> wrote: That said, I like the idea of a first class callable object. For the example above, doing this: class SortByKey implements Callable {} Note that this is what Java did since day one (it was thought that anonymous inner classes were good enough)

Re: [PHP-DEV] PATCH: anonymous functions in PHP

2007-03-22 Thread Michael Walter
On 3/22/07, Christian Schneider <[EMAIL PROTECTED]> wrote: Michael Walter wrote: > Which seems to fit Andi's $_SCOPE proposal. Yes, but is a point against a real closure proposal. I think the defining property of a "real" closure proposal is having the lexical scope

Re: [PHP-DEV] PATCH: anonymous functions in PHP

2007-03-22 Thread Michael Walter
Hi, On 3/22/07, Christian Schneider <[EMAIL PROTECTED]> wrote: Michael Walter wrote: > Right. But then those people add 2 + 2 and get frustrated because they > can't do the obvious ;) I find it all but obvious to being able to use non-local, non-global variables in PHP. It&

Re: [PHP-DEV] PATCH: anonymous functions in PHP

2007-03-22 Thread Michael Walter
Hi, On 3/21/07, Richard Lynch <[EMAIL PROTECTED]> wrote: I think solving the common need for 99% of the people with a nice simple clean anonymous function is PHP way. Right. But then those people add 2 + 2 and get frustrated because they can't do the obvious ;) If somebody has a real-life de

Re: [PHP-DEV] Comments on PHP security

2007-01-12 Thread Michael Walter
On 1/12/07, Michael B Allen <[EMAIL PROTECTED]> wrote: On Fri, 12 Jan 2007 11:40:32 -0500 Robert Cummings <[EMAIL PROTECTED]> wrote: > On Fri, 2007-01-12 at 15:57 +, Tim Starling wrote: > > > > Limits, table names, and several other query parts are protected by > > MediaWiki's query builder.

Re: [PHP-DEV] Re: __autoloading and functions

2006-09-11 Thread Michael Walter
On 9/11/06, Terje Slettebø <[EMAIL PROTECTED]> wrote: Please, people: The availability of free (non-member) functions in PHP (as in C/C++) is one advantage it has over Java, where everything _has_ to be a class. So in Java, instead of being able to write "sqrt()", you have to write "Math::sqrt()"

Re: [PHP-DEV] Re: __autoloading and functions

2006-09-11 Thread Michael Walter
On 9/11/06, Richard Quadling <[EMAIL PROTECTED]> wrote: One way in useerland to solve this is to use an error handler to identify non existant function calls and then use an appropriate mechanism to find them. You can't catch fatal errors. Regards, Michael -- PHP Internals - PHP Runtime Devel

[PHP-DEV] DateTime

2006-08-14 Thread Michael Walter
Hi, Is it on purpose that DateTime objects cannot be cloned? Regards, Michael -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Fatal errors

2006-08-10 Thread Michael Walter
What do you mean? Regards, Michael On 8/10/06, Marcus Boerger <[EMAIL PROTECTED]> wrote: Hello Michael, hwat are you doing there? You turn any new oop feature as oh php 5 into a joke. What do you aim at? Thursday, August 10, 2006, 12:02:09 PM, you wrote: > Hi, > right now, PHP triggers

Re: [PHP-DEV] Fatal errors

2006-08-10 Thread Michael Walter
What do you feel is incorrect about allowing mentioned errors to be handled in userspace? Regards, Michael On 8/10/06, Ilia Alshanetsky <[EMAIL PROTECTED]> wrote: On 10-Aug-06, at 6:02 AM, Michael Walter wrote: > Hi, > > right now, PHP triggers fatal errors e.g. when ac

Re: [PHP-DEV] Re: Fatal errors

2006-08-10 Thread Michael Walter
Hi, On 8/10/06, Derick Rethans <[EMAIL PROTECTED]> wrote: He wasn't talking about *undefined variables* at all. The variable *is* defined as private and calling that is ofcourse not allowed. I was talking about all kinds of errors which for no good reason are non-recoverable. Surely, the opera

Re: [PHP-DEV] Re: Fatal errors

2006-08-10 Thread Michael Walter
That doesn't justify the error being non-recoverable, though. Regards, Michael On 8/10/06, Lukas Kahwe Smith <[EMAIL PROTECTED]> wrote: Pierre wrote: > Hello, > > On 8/10/06, Michael Walter <[EMAIL PROTECTED]> wrote: >> Yeah. It is problematic that the appl

[PHP-DEV] Re: Fatal errors

2006-08-10 Thread Michael Walter
l On 8/10/06, Lukas Kahwe Smith <[EMAIL PROTECTED]> wrote: Michael Walter wrote: > Hi, > > right now, PHP triggers fatal errors e.g. when accessing private > members or calling nonexistant functions. Since this is problematic > for obvious reasons, what technical reasons are

[PHP-DEV] Fatal errors

2006-08-10 Thread Michael Walter
Hi, right now, PHP triggers fatal errors e.g. when accessing private members or calling nonexistant functions. Since this is problematic for obvious reasons, what technical reasons are there for that behavior, and is there a chance that this behaviour will change in a future release? Regards, Mi

Re: [PHP-DEV] Missing __toString() part

2006-06-03 Thread Michael Walter
Yes definitely, that functionality would be useful. Regards, Michael On 6/3/06, Pierre <[EMAIL PROTECTED]> wrote: Hi, On 6/3/06, Marcus Boerger <[EMAIL PROTECTED]> wrote: > Hello guys, > > the attached patch closes one more __toString() part. It allows > to use objects that define __toString

Re: [PHP-DEV] Re: Question regarding extension function entries.

2006-06-02 Thread Michael Walter
At least the C++ standard guarantees that all remaining members of the struct are initialized with their respective default value (which would is be 0/NULL). So technically speaking, simply using {NULL} is absolutely fine. From a cursory glance it appears to me that it is the same with C, but f

Re: [PHP-DEV] Template Linkage for a PhpClassFactory in C++

2006-03-14 Thread Michael Walter
I could be missing the point (only skimmed your mail), but you need to include your template implementation in every source file that tries to instantiate the template, e.g. by adding the code to the header file (the alternative, that is, explicitely instantiating the template in factory.cpp, would

Re: [PHP-DEV] Re: Named arguments revisited

2006-01-12 Thread Michael Walter
On 1/12/06, Robert Cummings <[EMAIL PROTECTED]> wrote: > On Thu, 2006-01-12 at 01:25, Jason Garber wrote: > > Hello Aidan, > > > > I think named parameters would be a useful feature... I'll leave it > > at that. > > > > Here is a coding idea for you, in case you hadn't considered it... > > >

Re: [PHP-DEV]

2005-12-01 Thread Michael Walter
Surely it ought to care iff trying to look like a processing instruction. But we digress... On 12/1/05, Bart de Boer <[EMAIL PROTECTED]> wrote: > So, that whitespace is meaningfull for XML. Not for PHP. PHP couldn't care > less how processing instructions are defined in XML. > -- PHP Internals -

Re: [PHP-DEV]

2005-12-01 Thread Michael Walter
Of course it is meaningful for PHP as well. On 12/1/05, Bart de Boer <[EMAIL PROTECTED]> wrote: > But that whitespace is meaningfull at XML level and not at PHP level. > > Processing Instruction: phpecho > > > Sean Coates wrote: > > Sara Golemon wrote: > > > >>> oh, that's easy to solve ' >>> > >>

Re: [PHP-DEV] Reference handling change and PHP 4.4.0

2005-09-15 Thread Michael Walter
On 9/15/05, Leigh Makewell <[EMAIL PROTECTED]> wrote: > [...] There are too many viable > options out there to warrant sticking with the relatively fragile and > limited PHP platform. "Change to Ruby. It's heaps better!" FWIW, Ruby is changing as well. Regards, Michael -- PHP Internals - PHP Run

Re: [PHP-DEV] Re: PHP 6.0 Wishlist

2005-08-23 Thread Michael Walter
Zeev, On 8/24/05, Michael Walter <[EMAIL PROTECTED]> wrote: > On 8/23/05, Zeev Suraski <[EMAIL PROTECTED]> wrote: > > >"Real" anonymous functions (as in, closures) should be able to capture > > >variables from its lexical environment, e.g.: > >

Re: [PHP-DEV] Re: PHP 6.0 Wishlist

2005-08-23 Thread Michael Walter
Zeev, On 8/23/05, Zeev Suraski <[EMAIL PROTECTED]> wrote: > >"Real" anonymous functions (as in, closures) should be able to capture > >variables from its lexical environment, e.g.: > > create_function() accepts a string, and that string is constructed with > full access to the lexical scope of th

Re: [PHP-DEV] Re: PHP 6.0 Wishlist

2005-08-23 Thread Michael Walter
On 8/22/05, Stanislav Malyshev <[EMAIL PROTECTED]> wrote: > MB>>> * Anonymous functions. The real stuff, not just some odd string > MB>>> passed to create_function(). > MB>> > MB>>There were some others already asking for this, maybe we should at least > MB>>give it a thought if it is doable at all

Re: [PHP-DEV] segmentation fault when passing arguments by reference or importing global variables

2005-02-21 Thread Michael Walter
I've as well experienced this problem several times (in a medium-size code base). By returning-by-reference in the wrong places, do you mean something like function foo() { return 10;} $bar=&foo(); I'm pretty convinced that even with "correct" (in that respect) code the crash still occurs. Mi

Re: [PHP-DEV] Class Destruction / Reloading

2004-08-18 Thread Michael Walter
Andi Gutmans wrote: At 08:23 PM 8/18/2004 -0400, Sean Coates wrote: Marcus Boerger wrote: >>Is this worth further discussion? > > Not before until we have an application server and php scripts that are > designed to run for several months. And even then we would also need > improved Reflection supp

Re: [PHP-DEV] Re: get_defined_constants()

2004-08-08 Thread Michael Walter
The latter is much more readable, though. Cheers, Michael Ron Korving wrote: it's a nice idea, and personally, i would prefer a simple boolean parameter instead of constants where there's only 2 possibilities anyway.. "Nathan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Dear List, i

Re: [PHP-DEV] GOTO operator

2004-07-31 Thread Michael Walter
Andi Gutmans wrote: I'm starting to like goto more and more :) Good good :) At least it's a simple concept as opposed to using/scoped which make me dizzy. Hehe, I think scoped could be pretty useful, though. Cheers, Michael At 03:24 AM 8/1/2004 +0200, Michael Walter wrote: Pa

Re: [PHP-DEV] GOTO operator

2004-07-31 Thread Michael Walter
Paul G wrote: - Original Message - From: "Michael Walter" <[EMAIL PROTECTED]> To: "Paul G" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, July 31, 2004 1:59 PM Subject: Re: [PHP-DEV] GOTO operator --- snip --- presumably, you see the need

Re: [PHP-DEV] GOTO operator

2004-07-31 Thread Michael Walter
Hiho, Paul G wrote: - Original Message - From: "Andi Gutmans" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, July 30, 2004 2:08 PM Subject: Re: [PHP-DEV] GOTO operator --- snip --- I'm sorry but I just don't understand the great need for goto in PHP and th

Re: [PHP-DEV] Re: keyword arguments?

2004-06-23 Thread Michael Walter
Bert Slagter wrote: > Even after reading your message twice, I can't think of an example where > this would be useful. Obviously, I don't understand your intention. The original poster wants to add syntax for keyword arguments. Keyword arguments can be found in quite some languages (Python, Common

Re: [PHP-DEV] str_repeat() patch

2004-06-13 Thread Michael Walter
Stefan Esser wrote: The whole discussion about memcpy beeing faster than memmove is completely pointless. [..] Agreed. Cheers, Michael -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] str_repeat() patch

2004-06-13 Thread Michael Walter
Well, surely memmove() needs an additional branch to check for overlapping, though (the OP was wrong in that memmove() would need a temporary buffer, though - it doesn't, it usually copies from high addres to low in the overlapping case). Cheers, Michael George Schlossnagle wrote: On Jun 12, 20

Re: [PHP-DEV] switch labels in sub-blocks

2004-05-29 Thread Michael Walter
Ilya Sher wrote: Hartmut Holzgraefe wrote: Ilya Sher wrote: It looks like using "goto" to me. Messy. That's probably the reason it is not allowed. Or maybe other people like myself failed to understand how it is really useful. Real example from you would help here. it's a valid performance trick i

Re: [PHP-DEV] [RFC] Type hints

2004-05-01 Thread Michael Walter
Marcus Boerger wrote: Hello internals, > [...] How about function foo(Class? bar) instead? Too much magic? Cheers, Michael -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Performance Consideration of 1 class per file

2004-04-24 Thread Michael Walter
Andi Gutmans wrote: At 01:49 AM 4/24/2004 -0700, Rasmus Lerdorf wrote: Overall I think you would get more bang for the buck by coming up with an intelligent caching stat/realpath implementation. The obvious drawback would be that symlinks and other filesystem changes done while the server is runn

Re: [PHP-DEV] Performance Consideration of 1 class per file

2004-04-24 Thread Michael Walter
Christian Schneider wrote: > [...] I guess someone _that_ considered about performance could easily do a cat *.php | grep -v require | php -w >app.lib or the like and include app.lib. Well yeah, it gets slightly harder when you dynamically require modules. Cheers, Michael -- PHP Internals - PHP Ru

Re: [PHP-DEV] Re: Multi-Method Dispatch in PHP 5.1?

2004-04-21 Thread Michael Walter
Christian Schneider wrote: Michael Walter wrote: How exactly do you think are default parameters related to the issue, anyway? Java uses multi-method dispatch to work around missing default values: function foo($a, $some_flag) { ... } function foo($a) { foo($a, false); } instead of function

Re: [PHP-DEV] Re: Multi-Method Dispatch in PHP 5.1?

2004-04-20 Thread Michael Walter
Christian Schneider wrote: Sebastian Bergmann wrote: Since we introduce class type hints in PHP 5.0 I think it would be a good thing [tm] to add multi-method dispatch in PHP 5.1. Actually I think multi-method dispatching for PHP is A Bad Thing[tm]. Multi-method dispatching is necessary for

Re: [PHP-DEV] stdClass

2004-02-27 Thread Michael Walter
Hartmut Holzgraefe wrote: Jakes wrote: Oh, yes and special methods that you mentioned would come in handy too but from a object perspective. Maybe explicitly calling some sort finalize() method to clean un-referenced objects would also be handy. finalize() is one of the worst concepts of JAVA

Re: [PHP-DEV] stdClass

2004-02-27 Thread Michael Walter
Jakes wrote: cool, Im going to look more into the engine to see the working. I suppose PHP it isn't as memory intensive as JAVA Quick question, does the zend engine have a garbage collector while we are on the topic? As said, it uses reference counting. Cheers, Michael "Hartmut Holzgraefe" <[EMA

Re: [PHP-DEV] stdClass

2004-02-27 Thread Michael Walter
Jakes wrote: Oh, yes and special methods that you mentioned would come in handy too but from a object perspective. Maybe explicitly calling some sort finalize() method to clean un-referenced objects would also be handy. How does that differ from $x=null; with a reference-counting garbage collector

Re: [PHP-DEV] stdClass

2004-02-27 Thread Michael Walter
Jakes Potgieter wrote: It would be nice to have a base class to inherit some special methods as we do in Java. [...] What would be useful methods contained in the base class? Thanks. - Original Message - From: "Stephan Schmidt" <[EMAIL PROTECTED]> Newsgroups: php.internals To: "'Jakes'"

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-27 Thread Michael Walter
George Schlossnagle wrote: On Feb 27, 2004, at 4:12 AM, Andi Gutmans wrote: Hey, I'd like to come to some conclusion about the latest changes which break BC (trying to keep it short because some people here wrote long essays and it took me too much time to catch up :) : a) I agree that it does

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible

2004-02-26 Thread Michael Walter
Ferdinand Beyer wrote: IMO we are trying to force a strict programming here that is incompatible with PHP's loose character. Well, I don't get the point in relation to *constructors* at all.. I mean, forcing the same signature for each constructor seems unreasonable to me (_when explicitely cal

Re: [PHP-DEV] Declaration of Bar::__construct() must be compatible with that of Foo::__construct()

2004-02-25 Thread Michael Walter
Timm Friebe wrote: [EMAIL PROTECTED]:~/devel/php/tests > cat inheritance.php class Foo { function __construct($foo) { } } class Bar extends Foo { function __construct($foo, $bar) { // Add = NULL after $bar to make it work } } ?> [EMAIL PROTECTED]:~/devel/php/te

Re: [PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_operators.c

2004-02-22 Thread Michael Walter
Andi Gutmans wrote: At 23:49 22/02/2004 +0100, Michael Walter wrote: No, -2147483648 is the lower bound and 2147483647 is the upper bound for signed integers. -2147483648 = 1000 2147483647 = 0111 it still doesn't explain the FPE here.

Re: [PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_operators.c

2004-02-22 Thread Michael Walter
Sterling Hughes wrote: George Schlossnagle wrote: On Feb 22, 2004, at 5:15 PM, Derick Rethans wrote: On Sun, 22 Feb 2004 [EMAIL PROTECTED] wrote: It's generating an idivl, which gives you an exception if the (signed) result is too large (a.k.a. integer overflow). Did you notice your compiler w

Re: [PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_operators.c

2004-02-22 Thread Michael Walter
George Schlossnagle wrote: On Feb 22, 2004, at 5:15 PM, Derick Rethans wrote: On Sun, 22 Feb 2004 [EMAIL PROTECTED] wrote: It's generating an idivl, which gives you an exception if the (signed) result is too large (a.k.a. integer overflow). Did you notice your compiler warning "this decimal const

Re: [PHP-DEV] Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_operators.c

2004-02-22 Thread Michael Walter
Derick Rethans wrote: >> [embarassing mistake] No, -2147483648 is the lower bound and 2147483647 is the upper bound for signed integers. Yes of course. -2147483648 = 1000 2147483647 = 0111 it still doesn't explain the FPE here. What does exp

Re: [PHP-DEV] Calling methods of parent/ancestor classes in PHP5

2004-02-18 Thread Michael Walter
Ferdinand Beyer wrote: > [...] C++ is difficult since it includes C. Nevertheless every C++ programmer is 100% coding (and thinking) object-oriented - even basic data types like strings are usually objects. This is rather wrong - one of C++' main strengths is that it allows multiple paradigms o

Re: [PHP-DEV] Calling methods of parent/ancestor classes in PHP5

2004-02-18 Thread Michael Walter
Ferdinand Beyer wrote: > [...] Well, I must confess that I do not know Perl (perhaps I'm to young). But I said "not available in any OO language" - neither Perl nor PHP are OO languages in my opinion (like Java, C++) so we should not use Perl as a role model here :-) What is your criterium of a

[PHP-DEV] Re: New destructors implementation

2004-02-07 Thread Michael Walter
Zeev Suraski wrote: At 00:58 07/02/2004, Christian Jerono wrote: Well so wouldn't 'reverse construction order' mean: $container=...; $obj = $container->getFoo(); results in call of $obj->__destruct(); and then $container->__destruct(); maybe i just missed the problem here? Yes, and yes you did :

Re: [PHP-DEV] New destructors implementation

2004-02-06 Thread Michael Walter
Zeev Suraski wrote: At 13:01 06/02/2004, Stephane Drouard wrote: == Quote from Red Wingate ([EMAIL PROTECTED])'s article > Is the removal of a specific order on the __destruct() calls > necessary? It's a pain in the ass the be unable to predict > in which order the __destruct() calls are made. I d

Re: [PHP-DEV] New destructors implementation

2004-02-06 Thread Michael Walter
Stephane Drouard wrote: == Quote from Red Wingate ([EMAIL PROTECTED])'s article Is the removal of a specific order on the __destruct() calls necessary? It's a pain in the ass the be unable to predict in which order the __destruct() calls are made. [..] Couldn't PHP implement global object destruct

Re: [PHP-DEV] New destructors implementation

2004-02-04 Thread Michael Walter
Hi Andi, Andi Gutmans wrote: > [...] > > This has several implications: > > [...] > > 2. A *VERY* important implication is that you cannot, and must not rely in any way on the order of destruction during shutdown. It runs in no particular order. That means that by the time the destructor for

Re: [PHP-DEV] __destruct() not called

2004-01-17 Thread Michael Walter
Do you have circular references between 2+ objects? The __destruct() method won't be called then for those, I suppose. Cheers, Michael Sebastian Bergmann wrote: The __destruct() method of the PHPUnit_Extensions_Logger_XML class (part of PHPUnit) is not beeing called. To reproduce: 1.)

Re: [PHP-DEV] is get_class() case-sensitive now?

2004-01-14 Thread Michael Walter
It seems to me the certain amounts of case insensitivity which are still part of PHP start making less and less sense. Cheers, Michael -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] error_handler

2003-12-19 Thread Michael Walter
Daniel Convissor wrote: On Fri, Dec 19, 2003 at 08:49:10PM +0100, Andrey Hristov wrote: So the code with @ is "working". The set_error_handler() is bailing out and everything is ok No, the erorr handler isn't being called and that's not okay. --Dan Well, you could simply do like set_error_ha

Re: [PHP-DEV] array_reverse

2003-12-14 Thread Michael Walter
Felipe Lopes wrote: Hi there! What you guys think about make array_reverse() a variable referenced function. I mean something like: function new_array_reverse(&$array){ $array = array_reverse($array); } -1 from me (supposed my vote counts ;), as this works pretty much against functional

Re: [PHP-DEV] "Multiple Inheritance" for Interfaces

2003-12-13 Thread Michael Walter
Cesare D'Amico wrote: Alle 16:09, sabato 13 dicembre 2003, Sebastian Bergmann ha scritto: - Does interface C implements A, B {} do what I want? This syntax sounds strange to me: an interface should'nt _implement_ other interfaces... sounds as nonsense. That might be part of his

Re: [PHP-DEV] End to StudlyCaps thread (hopefully)

2003-12-08 Thread Michael Walter
with a slight advantage to StudlyCaps) I think it's the right way to go [..] or we'll never get any closure. [..] You got closures for me? Lexical ones? Whee ;) Cheers, Michael -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] StudlyCaps

2003-12-03 Thread Michael Walter
Melvyn Sopacua wrote: On Wednesday 03 December 2003 23:35, Michael Walter wrote: Markus Fischer wrote: > [...] I like the initial argument brought up by Mr. Wendel, namely to easily differentiate between PHP method calls and userland written method calls. - Markus (

Re: [PHP-DEV] StudlyCaps

2003-12-03 Thread Michael Walter
Andi Gutmans wrote: At 11:35 PM 12/3/2003 +0100, Michael Walter wrote: Markus Fischer wrote: > [...] I like the initial argument brought up by Mr. Wendel, namely to easily differentiate between PHP method calls and userland written method calls. - Markus (and

Re: [PHP-DEV] StudlyCaps

2003-12-03 Thread Michael Walter
Markus Fischer wrote: > [...] I like the initial argument brought up by Mr. Wendel, namely to easily differentiate between PHP method calls and userland written method calls. - Markus (and his cow) How is this an advantage? Cheers, Michael -- PHP Internals - PHP Runtime De

Re: [PHP-DEV] StudlyCaps

2003-12-03 Thread Michael Walter
Sascha Schumann wrote: -1 on embracing studlyCaps in the context of PHP itself. (Note: studlyCaps originated with a OO language, namely Smalltalk, but it is not pervasive in OO land. If you don't believe me, just look at the STL. You won't find any uglyCaps over there.)

Re: [PHP-DEV] StudlyCaps

2003-12-03 Thread Michael Walter
George Schlossnagle wrote: On the other hand, there are Common Lisp (foo-bar-baz), Python (mostly foobarbaz) and Ruby (mostly foo_bar_baz). To be pedantic, the Python style guide (http://www.python.org/peps/pep-0008.html) specifies class names to be StudlyCaps and method names to be either und

Re: [PHP-DEV] StudlyCaps

2003-12-03 Thread Michael Walter
George Schlossnagle wrote: My vote is on StudlyCaps for class method and attribute names. This is the standard in many OO languages (SmallTalk, C#, Java - as a parenthetical I don't think that SmallTalks adoption of StudlyCaps (one of the first I'm aware of) had anything to do with _ rendering)

Re: [PHP-DEV] Re: Summary of string conversion problem

2003-12-01 Thread Michael Walter
Christian Schneider wrote: >[...] c) $arr[$obj] would suddenly work according the __toString(). I remember this being requested as a feature anyway ;-) The feature request was about using objects as hash indices, not their string representation (IIRC). Cheers, Michael -- PHP Internals - PHP Ru

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /tests/classes array_access_001.phpt array_access_002.phpt array_access_003.phpt array_access_004.phpt ZendEngine2 zend_execute.c zend_interfaces.c zend_interfaces.h zend_object_handlers.c zend_operators.c zend_operators.h

2003-11-25 Thread Michael Walter
Well, I can live with any of those names :) Didn't realize either, that it would be that much of a deal to rename an interface ;) I wasn't talking about is_a(), though, but of the general concept of using inheritance for modelling "is a" relationships, hence the name recommendation. Although, a

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /tests/classes array_access_001.phpt array_access_002.phpt array_access_003.phpt array_access_004.phpt ZendEngine2 zend_execute.c zend_interfaces.c zend_interfaces.h zend_object_handlers.c zend_operators.c zend_operators.h

2003-11-24 Thread Michael Walter
(Gotta admit though, that it goes okay with "implements". Not sure whether I still have a point, though, as still dealing with inheritance) And how about calling it Indexable, or something that can be used in a "is a" sentence? As in, you could say "MyArray is an Indexable", but "MyArray is an

Re: [PHP-DEV] Re: [PHP-CVS] cvs: php-src /tests/classes array_access_001.phpt array_access_002.phpt array_access_003.phpt array_access_004.phpt ZendEngine2 zend_execute.c zend_interfaces.c zend_interfaces.h zend_object_handlers.c zend_operators.c zend_operators.h

2003-11-24 Thread Michael Walter
And how about calling it Indexable, or something that can be used in a "is a" sentence? As in, you could say "MyArray is an Indexable", but "MyArray is an ArrayAccess" sounds just wrong ;) Cheers, Michael Marcus Boerger wrote: Hello Sebastian, Monday, November 24, 2003, 10:37:50 PM, you wrote:

Re: [PHP-DEV] E_STRICT

2003-11-19 Thread Michael Walter
Jani Taskinen wrote: On Wed, 19 Nov 2003, Michael Walter wrote: Spotting a missing function is quite easy, your script simply won't work and give a clear error.. :) Well, not exactly :) It might just not work anymore at some time in the future (as you know you never really have 100%

Re: [PHP-DEV] E_STRICT

2003-11-19 Thread Michael Walter
So, when upgrading, you just go through the new entries, and grep your source files for occurences - no big deal. Where's the missing point? ;) No one reads the NEWS file. And everone will get the default answer "read the NEWS" once he complains :) Or you might even add a notice _in the error

Re: [PHP-DEV] E_STRICT

2003-11-19 Thread Michael Walter
Spotting a missing function is quite easy, your script simply won't work and give a clear error.. :) Well, not exactly :) It might just not work anymore at some time in the future (as you know you never really have 100% code coverage, even with unit testing and stuff. it's way less than 1

Re: [PHP-DEV] php5 method return reference error?

2003-11-13 Thread Michael Walter
you're dealing with objects. Cheers, Michael Walter A. Boring IV wrote: Howdy, I'm playing with php5 (from cvs), and came accross a strange error that doesn't happen with php4. Maybe someone can shed some light on this for me? I get the error "Fatal error: Only variable

Re: [PHP-DEV] Repost : 64 Bit Integer support

2003-11-06 Thread Michael Walter
Maybe something like that could help you: #define HAS_INT64_PRIMITIVE #ifdef MSVC #define int64_t __int64 #elif ... #else typedef struct int64_t_ { int32_t a, b; } int64_t; #undef HAS_INT64_PRIMITIVE #endif - Michael -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: h

Re: [PHP-DEV] Proposal: Array syntax

2003-11-05 Thread Michael Walter
Marco Tabini wrote: George Schlossnagle wrote: On Nov 5, 2003, at 1:29 PM, Marco Tabini wrote: $a = [1,2,$b[11]] is semantically inconsistent. How so? Is I think I've already explained why. Not really understandable, though. foo(array(1,2)); semantically inconsistent? On one hand () is us

Re: [PHP-DEV] Proposal: Array syntax

2003-11-05 Thread Michael Walter
I guess we'll have to agree to disagree $a = [1,2,$b[11]] is semantically inconsistent. Yeah, I agree to disagree on that one, too :) Actually, do you realize that you use () both for "grouping" and for application? I can't see anything wrong with using square brackets for array element access

Re: [PHP-DEV] Proposal: Array syntax

2003-11-05 Thread Michael Walter
I like some of the Python syntax. But some of it is cumbersome. Same with PHP. But I think PHP is closer to what I want so what's wrong with trying to improve it where it's possible (and easily done)? agree, and you can easily make PHP code not readable with such improvements. again, I can't un

Re: [PHP-DEV] Proposal: Array syntax

2003-11-05 Thread Michael Walter
$a = [1,2,$b[11]]; Is that confusing enough for you? ;-) What's confusing about it? The fact that $b[11] references an item of an array, while [1,2,$b[11]] assigns values to the array $a. The fact that you (and, probably, most of us) can't tell right off the bat is a clear sign that this is a

Re: [PHP-DEV] Proposal: Array syntax

2003-11-05 Thread Michael Walter
Very cool. How about supporting .. syntax, btw. as in [1..3] or ["a".."z"]? Might no be the worth, just thinking out loud ;) "might not be worth it".. Christian Schneider wrote: I propose to add an alternative (backward compatible) short array creation syntax: $a = [ 1, 2, 3 ]; and $a = [ 'a' =

Re: [PHP-DEV] Proposal: Array syntax

2003-11-05 Thread Michael Walter
Very cool. How about supporting .. syntax, btw. as in [1..3] or ["a".."z"]? Might no be the worth, just thinking out loud ;) Christian Schneider wrote: I propose to add an alternative (backward compatible) short array creation syntax: $a = [ 1, 2, 3 ]; and $a = [ 'a' => 42, 'b' => "foo" ]; It

Re: [PHP-DEV] PHP 5 Beta 2 RC1

2003-10-25 Thread Michael Walter
For the ptrdiff_t error, you could just #include . Concerning ssize_t - that isn't a type defined anywhere in the C standard libary, so you have to typedef it by yourself. Alternatively, you could include and typedef SSIZE_T ssize_t; Steph wrote: btw if you replace ssize_t nbytes = 0; with in

Re: [PHP-DEV] Re: named function arguments

2003-10-24 Thread Michael Walter
Sebastian Bergmann wrote: Named parameters are commonly implemented using an associated array in PHP: foo( array( 'foo' => 'bar', 'bar' => 'foo' ) ); ?> So, how do you think that isn't known to the original poster as he even explicitely states that