Re: [PHP-DEV] Built-in function: between

2010-09-30 Thread Philip Olson
On Sep 30, 2010, at 7:14 AM, Johannes Schlüter wrote: > On Thu, 2010-09-30 at 16:37 +0300, Adi Nita wrote: >> Perhaps a better idea would be to group the ones that we already have >> under a common namespace. But this is no news, though. > > Even then it would be unlikely that we add another spe

Re: [PHP-DEV] Built-in function: between

2010-09-30 Thread Adi Nita
Completely agree. Adding another specialized string function wouldn't be worth in this case. I was just trying to divert the attention :) to PHP (still) not using namespaced functionalities even where it makes sense the most (text / string, array etc.) 2010/9/30 Johannes Schlüter > On Thu, 2010

Re: [PHP-DEV] Built-in function: between

2010-09-30 Thread Johannes Schlüter
On Thu, 2010-09-30 at 16:37 +0300, Adi Nita wrote: > Perhaps a better idea would be to group the ones that we already have > under a common namespace. But this is no news, though. Even then it would be unlikely that we add another special purpose function. This would have to be an important featur

Re: [PHP-DEV] Built-in function: between

2010-09-30 Thread Adi Nita
Perhaps a better idea would be to group the ones that we already have under a common namespace. But this is no news, though. Adrian 2010/9/30 Johannes Schlüter > On Thu, 2010-09-30 at 15:11 +0200, Andre Baumeier wrote: > > Am 05.09.2010 um 15:06 schrieb Johannes Schlüter: > > > > > preg_match(

Re: [PHP-DEV] Built-in function: between

2010-09-30 Thread Johannes Schlüter
On Thu, 2010-09-30 at 15:11 +0200, Andre Baumeier wrote: > Am 05.09.2010 um 15:06 schrieb Johannes Schlüter: > > > preg_match('/PHP (.*) swesome/', 'PHP is awesome', $matches); > > > > preg_match should be slower? Was that a question or a statement? I doubt it is really measurable and not wort

Re: [PHP-DEV] Built-in function: between

2010-09-30 Thread Andre Baumeier
Am 05.09.2010 um 15:06 schrieb Johannes Schlüter: > preg_match('/PHP (.*) swesome/', 'PHP is awesome', $matches); > preg_match should be slower? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Built-in function: between

2010-09-05 Thread Johannes Schlüter
On Sat, 2010-09-04 at 21:52 +0200, Alex Baumann wrote: > Hi! > Since I'm using this function in each project I'm working on, how about > making it a built-in function? > > function between ($text, $between, $and) { > $start = strpos($text, $between)+strlen($between); > if ($start === fa