Re: [PHP-DEV] Generators in PHP

2012-06-11 Thread Jevon Wright
I don't understand why you need to introduce two new keywords into the language - * and yield. Could you not solve it like follows? // Generator implements Iterable class AllEvenNumbers extends Generator { private $i; public __construct() { $this->i = 0; } function generate() { return

Re: [PHP-DEV] Adding a more logical string slicing function to PHP

2011-03-30 Thread Jevon Wright
If substr() really was so bad, then surely we'd see userland implementations of str_slice() in every project? Jevon On Wed, Mar 30, 2011 at 7:06 PM, Dan Birken wrote: > My apologizes if I am bringing up a topic that has been discussed before, > this is my first time wading into the PHP developer

Re: [PHP-DEV] RE:

2008-10-27 Thread Jevon Wright
So does that mean the new NS operator is actually \\ and not \ ? No developer is going to be relying on single \'s -- too likely to become an error in maintenence, and too inconsistent (see strings discussion). Jevon On Tue, Oct 28, 2008 at 12:11 AM, Arvids Godjuks <[EMAIL PROTECTED]>wrote: > T

Re: [PHP-DEV] dropping curly braces

2005-11-17 Thread Jevon Wright
Is there anything wrong with having a convention for character access of strings? Most PHP programmers see {} as string access and [] as array access - sure, they might be functionally identical, but its the convention which is important. Jevon > ---Original Message--- > From: Rasmu

Re: [PHP-DEV] Unicode Implementation

2005-10-13 Thread Jevon Wright
Ditto please! Jevon - Original Message - From: "Ron Korving" <[EMAIL PROTECTED]> To: Sent: Thursday, October 13, 2005 8:27 PM Subject: [php] Re: [PHP-DEV] Unicode Implementation > Well, if you want my 2 cents as well, the 2 cents a PHP user is very willing > to share with you guys...

Re: [PHP-DEV] Re: [sqlite] PHP5 && SQLite3

2004-10-21 Thread Jevon Wright
Probably covered by your "engine" point: please get __toString() to work properly with string concatenation and casting :) Thanks, Jevon - Original Message - From: "Andi Gutmans" <[EMAIL PROTECTED]> To: "Greg Beaver" <[EMAIL PROTECTED]> Cc: "internals" <[EMAIL PROTECTED]> Sent: Friday,

Re: [PHP-DEV] suggestion: empty() with infinite parameters like isset()

2004-10-20 Thread Jevon Wright
How about anyempty($var1, $var2, $var3, ...) ? Jevon - Original Message - From: "Ron Korving" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 21, 2004 12:21 AM Subject: Re: [PHP-DEV] suggestion: empty() with infinite parameters like isset() > Maybe it was a bad exam

Re: [PHP-DEV] Nesting level too deep - recursive dependency?

2004-10-19 Thread Jevon Wright
That's a really elegant solution... I'm up for trying that out. Remember to do != too :) Jevon - Original Message - From: "Andi Gutmans" <[EMAIL PROTECTED]> To: "Greg Beaver" <[EMAIL PROTECTED]>; "Jevon Wright" <[EMAIL PROTECTED]>

Re: [PHP-DEV] Nesting level too deep - recursive dependency?

2004-10-18 Thread Jevon Wright
I first stumbled upon this problem in one of the RCs for PHP 5, but at the time I thought I was at fault... Consider the documentation at http://www.php.net/manual/en/language.oop5.object-comparison.php : the documentation is a little vague, but it does say "Two object instances are equal if they

Re: [PHP-DEV] Type hints with null default values

2004-10-16 Thread Jevon Wright
Alternatively, you could try to support polymorphism in classes :o) Then you wouldn't need null references... class X { function a(); function a(MyObj $b); } Jevon Wright - Original Message - From: "Robert Silva" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED

Re: [PHP-DEV] is_a() vs. instanceof

2004-08-12 Thread Jevon Wright
What about: if (get_class($obj) == "unloadedclass") { // blah } Jevon - Original Message - From: "Al Baker" <[EMAIL PROTECTED]> To: "Hans Lellelid" <[EMAIL PROTECTED]> Cc: "Dan Ostrowski" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, August 12, 2004 9:58 PM Subject: Re: [

Re: [PHP-DEV] Date Support

2004-08-02 Thread Jevon Wright
I always wished that PHP had VB's set of operators on dates/times... (and also in SQL): year(), month(), date(), time_serial(), and the like. Yes, you can do it with date("...", $x); but then it's just awkward to remember all the operators. Also, I'd always wished that PHP would have support for d

Re: [PHP-DEV] GOTO operator

2004-07-30 Thread Jevon Wright
Why not make it hard for users to use GOTO in the first place? Develop some wacky construct that you have to use instead... that way, it will scare off novice users, and expert programmers will HAVE to know what they're doing and know that they really need it before they have to implement it. It's

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

2004-06-24 Thread Jevon Wright
Wouldn't a good (not necessarily better) idea in your case be to use an object? Instead of function foo(named $a, named $b, named $c, named $d, ..., named $z) echo foo(a := $a, c := $c, e := $e, ...); you'd have class Foo { ... } $f = new Foo(); $f->setA($a); $f->setC($c);

Re: [PHP-DEV] stripslashes() improvements

2004-06-09 Thread Jevon Wright
> echo "Stripslashes test: "; > ini_set('magic_quotes_sybase', 0); > $s = 'c:\\windows\\system32'; > $s1 = '\\'; > if ($s == stripslashes($s) && $s1 == stripslashes($s1)) echo "OK\n"; > else echo "FAILED\n"; > ?> 'c:\\windows\\system32' becomes 'c:\windows\system32' in memory (the slashes are str

Re: [PHP-DEV] Use of 'self' in static function in subclass

2004-06-01 Thread Jevon Wright
It's something I noticed, too. Consider this: class A { function a() { return $this::b(); } function b() { return 1; } } class B extends A { function b() { return 2; } } If I call $b = new B(); echo $b->a(); No matter what combination of this, self, parent, ... - I could never get B

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

2004-05-11 Thread Jevon Wright
If so, maybe allow the type hint to always succeed, if it's got NULL as the default parameter? (that way foo() wouldn't act differently to foo(NULL), even though they both mean the same thing, ignoring the type hint) Jevon - Original Message - From: "Timm Friebe" <[EMAIL PROTECTED]> To:

Re: [PHP-DEV] Read PHP script from...

2004-05-07 Thread Jevon Wright
Well, if you can get the file source out of the archive into a string, you could then eval() it. Hope this helps, Jevon - Original Message - From: "Srdjan Mijanovic" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, May 08, 2004 5:51 AM Subject: [PHP-DEV] Read PHP script from.

Re: [PHP-DEV] Implicit Arrays and E_STRICT

2004-05-07 Thread Jevon Wright
Won't you then have to recursively initialise multiple dimension arrays? $a = array(); $a[0] = array(); Otherwise, isn't this implicitly creating arrays? (I didn't quite understand the last time) Jevon - Original Message - From: "Jason Garber" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]

Re: [PHP-DEV] Reflection API : Feature request and question

2004-05-05 Thread Jevon Wright
- Original Message - From: "Arjen Warendorff" <[EMAIL PROTECTED]> To: "'PHP Internals List'" <[EMAIL PROTECTED]> Sent: Wednesday, May 05, 2004 7:33 PM Subject: [PHP-DEV] Reflection API : Feature request and question > Hello, > > I have played around with the Reflection API, missed some f

Re: [PHP-DEV] nested includes fails?

2004-05-04 Thread Jevon Wright
I tried this and it didn't fail... Jevon - Original Message - From: "Tumurbaatar S." <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 05, 2004 1:32 PM Subject: Re: [PHP-DEV] nested includes fails? > Hi, Jevon, > Mine is not so complex: > > //all files in 'inc' include

Re: [PHP-DEV] nested includes fails?

2004-05-04 Thread Jevon Wright
- From: "Andi Gutmans" <[EMAIL PROTECTED]> To: "Jevon Wright" <[EMAIL PROTECTED]>; "Tumurbaatar S." <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, May 04, 2004 11:50 PM Subject: Re: [PHP-DEV] nested includes fails? > Can you gi

Re: [PHP-DEV] nested includes fails?

2004-05-04 Thread Jevon Wright
I tested it on PHP 5 RC1, Win XP SP1, IIS 5.1 running as CGI - it didn't fail. I tried it on PHP 5 RC2, Win XP SP1, IIS 5.1 running as CGI - it didn't fail then, either. (Calling c.php) a.php b.php c.php common.php Jevon - Original Message - From: "Tumurbaatar S."

Re: [PHP-DEV] [PATCH] Repost - Adding Output Filters w/ Apache2 Handler SAPI

2004-04-29 Thread Jevon Wright
What if you extended this to cover PHP in general - you could make your PHP always generate XML data and then with add_output_filter(proprietary string or callback function) you could make PHP transform the output at the end of the script execution (possibly multiple times). I know a lot of develop

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

2004-04-21 Thread Jevon Wright
But at the same time, it would be nice to have a standardised multi-method syntax or code - or users might develop their own weird and wacky, inconsistent ways of implementing it. Perhaps the code submitted before could be included in the PHP documentation, telling users on how they could emulate t

Re: [PHP-DEV] Exceptions and Errors

2004-04-15 Thread Jevon Wright
> Guys, I'm am not for forcing people to use exceptions. I agree that we > should make PHP another Java exceptions from hell (especially with their > exception declarations in function prototypes which is horrible). I'm just > saying, that some extensions might benefit from exceptions and the > ext

Re: [PHP-DEV] Exceptions and Errors

2004-04-13 Thread Jevon Wright
> Your example is interesting. It shows an error that would be continuable > from an engine's point of view but not from the script's point of view. It > shows that there should not be any possibility to recover from exceptions > at the exact spot where the exception was thrown - anyway somthing th

Re: [PHP-DEV] __toString() with cast is broken in php5 RC1

2004-04-01 Thread Jevon Wright
Can you add a default __toString() for all objects (which don't extend or implement a __toString()) then? Because at least then we could use $str = $anyobj->__toString(). Otherwise I don't think __toString() has any real functionality, except for print and echo... Jevon - Original Message ---

Re: [PHP-DEV] Studlycaps and MySQLi

2004-03-23 Thread Jevon Wright
I'm in the "change it to be consistent" boat - Original Message - From: "Andi Gutmans" <[EMAIL PROTECTED]> To: "Rasmus Lerdorf" <[EMAIL PROTECTED]>; "Georg Richter" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; "George Schlossnagle" <[EMAIL PROTECTED]>; "Edin Kadribasic" <[EMAIL PROTEC