Hi
As SEEK_END only makes sense with zero or negative offsets (for arrays anyway),
I've come up with an implementation for SEEK_END:
http://phpbenelux.eu/array_seek.patch.txt
So you can do:
$arr = array('a', 'b', 'c', 'd');
echo array_seek($arr, -2, SEEK_END); // outputs 'b'
echo array_seek($arr
On Tue, Mar 16, 2010 at 17:12, Mikko Koppanen wrote:
> On Tue, Mar 16, 2010 at 2:12 PM, Christian Schneider
> wrote
>> I thinks the user space implementation
>>
>> function array_seek($array, $pos)
>> {
>> $a = array_values($array);
>> return $a[$pos];
>> }
>>
>> is simple enough to
> -Original Message-
> From: Felix De Vliegher [mailto:felix.devlieg...@gmail.com]
> Sent: 16 March 2010 13:31
> To: PHP internals
> Subject: [PHP-DEV] array_seek function
>
> Hi all
>
> I recently needed seek functionality in arrays, and couldn't
> find it in the regular set of arra
On Tue, 2010-03-16 at 22:13 +0100, Lukas Kahwe Smith wrote:
> On 16.03.2010, at 16:58, Derick Rethans wrote:
>
> > Before we add features, they need to be discussed whether we want to
> > have them. As version name for it I would like to use "trunk-dev" (and
> > not 5.4-dev or 6.0-dev) as we're
On Tue, Mar 16, 2010 at 9:43 PM, dreamcat four wrote:
> And remember,
>
> Its not just the number of times its send to ICU for conversion. Its
> also the number of times your UTF-16 string has to be converted back
> into utf-8 afterwards. This is why Apple makes its utf-16 strings
> immutable. So
On Sun, Mar 14, 2010 at 09:15:37AM -0400, Wez Furlong wrote:
> I'm sure that the docs team will add this to the manual if you ask them
> politely.
>
> Specifically, PDO_SQLITE defaults to a 60 second busy timeout. This can
> be changed by setting PDO::ATTR_TIMEOUT. The value is specified in
>
On 16.03.2010, at 16:58, Derick Rethans wrote:
> I've just renamed the 5.4 branch to THE_5_4_THAT_ISNT_5_4 and moved
Eventually it should be deleted, if it helps at all in merging the OB change
then it should be kept until that happens, otherwise it can be deleted now
imho. The new 5.3 based
On 16.03.2010, at 16:58, Derick Rethans wrote:
> Before we add features, they need to be discussed whether we want to
> have them. As version name for it I would like to use "trunk-dev" (and
> not 5.4-dev or 6.0-dev) as we're not quite sure where this is moving.
> Right now, there are the foll
On 16.03.2010, at 19:23, Hannes Magnusson wrote:
> On Tue, Mar 16, 2010 at 16:58, Derick Rethans wrote:
>> Before we add features, they need to be discussed whether we want to
>> have them.
>
> Does that mean you want to take up a
> - strict RFC-and-after-3months-discussion-before-commit policy
And remember,
Its not just the number of times its send to ICU for conversion. Its
also the number of times your UTF-16 string has to be converted back
into utf-8 afterwards. This is why Apple makes its utf-16 strings
immutable. So they are read-only, and the utf-8 representation can be
cached aft
On 3/16/2010 6:48 AM, dreamcat four wrote:
>
> Sure UTF-16 can make sense. But only if your external representations
> are also in UTF-16. So whats the default Unicode settings for MYSQL,
> POSTGRE, etc? Well, are they always set to UTF-8, or UTF-16?
This is a very good point. The PHP project co
Rasmus Lerdorf wrote:
On 03/16/2010 12:05 PM, dreamcat four wrote:
On Tue, Mar 16, 2010 at 6:32 PM, Rasmus Lerdorf wrote:
On 03/16/2010 10:40 AM, dreamcat four wrote:
As for text files on disk, if they are unicode, they are most commonly
utf-8 too. So then, why use utf-16 as internal unicode
Right now, it returns the value of a given position.
How it's different from:
array_slice() returns the sequence of elements from the array array as
specified by the offset and length parameters?
array_slice returns an array of elements. This function would return the
value at the given posi
Hi!
Right now, it returns the value of a given position.
How it's different from:
array_slice() returns the sequence of elements from the array array as
specified by the offset and length parameters?
--
Stanislav Malyshev, Zend Software Architect
s...@zend.com http://www.zend.com/
(408
Hi!
Does that mean you want to take up a
- strict RFC-and-after-3months-discussion-before-commit policy
(i.e. killing the scratching-an-itch spirit of PHP)
- "I'm going to commit this patch tomorrow" mail to internals@
(i.e. killing "I need this functionality, maybe others do to" spiri
On 03/16/2010 11:00 PM, Johannes Schlüter wrote:
> On Tue, 2010-03-16 at 19:11 +0300, Alexey Zakhlestin wrote:
>> + merge php-fpm branch?
>
> If we get a trunk which will be released in a foreseeable timeframe we
> don't need to merge this to 5.3 anymore, which had been an old plan.
> Tony, do you
On Tue, Mar 16, 2010 at 8:05 PM, Stanislav Malyshev wrote:
> Hi!
>
>> On disk storage should probably be UTF-8 without any question? Windows
>> use of widestrings for some files simple doubles up the on disk storage
>
> As file content, it's OK (an it'd be easy to add option to specify content
> t
On Tue, 2010-03-16 at 19:11 +0300, Alexey Zakhlestin wrote:
> + merge php-fpm branch?
If we get a trunk which will be released in a foreseeable timeframe we
don't need to merge this to 5.3 anymore, which had been an old plan.
Tony, do you agree?
johannes
--
PHP Internals - PHP Runtime Developm
On 03/16/2010 12:05 PM, dreamcat four wrote:
> On Tue, Mar 16, 2010 at 6:32 PM, Rasmus Lerdorf wrote:
>> On 03/16/2010 10:40 AM, dreamcat four wrote:
>>> As for text files on disk, if they are unicode, they are most commonly
>>> utf-8 too. So then, why use utf-16 as internal unicode representation
On Tue, Mar 16, 2010 at 7:32 PM, Rasmus Lerdorf wrote:
> Well, the obvious original reason is that ICU uses UTF-16 internally and
> the logic was that we would be going in and out of ICU to do all the
> various Unicode operations many more times than we would be interfacing
> with external things
On Tue, Mar 16, 2010 at 6:32 PM, Rasmus Lerdorf wrote:
> On 03/16/2010 10:40 AM, dreamcat four wrote:
>> As for text files on disk, if they are unicode, they are most commonly
>> utf-8 too. So then, why use utf-16 as internal unicode representation
>> in Php? It doesn't really make a lot of sense
Hi!
On disk storage should probably be UTF-8 without any question? Windows
use of widestrings for some files simple doubles up the on disk storage
As file content, it's OK (an it'd be easy to add option to specify
content transformation if we wanted), but prescribing filenames as UTF-8
would
Rasmus Lerdorf wrote:
On 03/16/2010 10:40 AM, dreamcat four wrote:
As for text files on disk, if they are unicode, they are most commonly
utf-8 too. So then, why use utf-16 as internal unicode representation
in Php? It doesn't really make a lot of sense for most regular people
who want to use Ph
On 03/16/2010 10:40 AM, dreamcat four wrote:
> As for text files on disk, if they are unicode, they are most commonly
> utf-8 too. So then, why use utf-16 as internal unicode representation
> in Php? It doesn't really make a lot of sense for most regular people
> who want to use Php for their web a
dreamcat four wrote:
On Tue, Mar 16, 2010 at 11:48 AM, dreamcat four wrote:
On Tue, Mar 16, 2010 at 8:30 AM, Lester Caine wrote:
'3' is not a very processor friendly number, so working with 4 even though
wasteful on memory, does make perfect sense. How long is it since we had a
640k limit on
On Tue, Mar 16, 2010 at 16:58, Derick Rethans wrote:
> Before we add features, they need to be discussed whether we want to
> have them.
Does that mean you want to take up a
- strict RFC-and-after-3months-discussion-before-commit policy
(i.e. killing the scratching-an-itch spirit of PHP)
- "I
On Tue, Mar 16, 2010 at 17:54, Pierre Joye wrote:
> On Tue, Mar 16, 2010 at 5:43 PM, Sebastian Bergmann
> wrote:
>> Am 16.03.2010 16:58, schrieb Derick Rethans:
>>> I've just renamed the 5.4 branch to THE_5_4_THAT_ISNT_5_4 and moved
>>> trunk to the branch FIRST_UNICODE_IMPLEMENTATION.
>>
>> Why
On Tue, Mar 16, 2010 at 4:22 PM, Derick Rethans wrote:
> I was also thinking, can we just make this work just like fseek (with a
> "whence" parameter) as well? (http://uk3.php.net/fseek)
Hi,
not sure how SEEK_END is supposed to work with arrays but here is
SEEK_SET and SEEK_CUR (with positive an
On Tue, Mar 16, 2010 at 11:48 AM, dreamcat four wrote:
> On Tue, Mar 16, 2010 at 8:30 AM, Lester Caine wrote:
>> '3' is not a very processor friendly number, so working with 4 even though
>> wasteful on memory, does make perfect sense. How long is it since we had a
>> 640k limit on working memory
On Tue, Mar 16, 2010 at 5:43 PM, Sebastian Bergmann
wrote:
> Am 16.03.2010 16:58, schrieb Derick Rethans:
>> I've just renamed the 5.4 branch to THE_5_4_THAT_ISNT_5_4 and moved
>> trunk to the branch FIRST_UNICODE_IMPLEMENTATION.
>
> Why do we need THE_5_4_THAT_ISNT_5_4
Right, this branch must b
Am 16.03.2010 16:58, schrieb Derick Rethans:
> I've just renamed the 5.4 branch to THE_5_4_THAT_ISNT_5_4 and moved
> trunk to the branch FIRST_UNICODE_IMPLEMENTATION.
Why do we need THE_5_4_THAT_ISNT_5_4 and trunk? trunk should be where
the development happens. When the time comes for a release
On Tue, 16 Mar 2010, Felix De Vliegher wrote:
> On 16-mrt-2010, at 17:07, Derick Rethans wrote:
>
> > On Tue, 16 Mar 2010, Felix De Vliegher wrote:
> >
> >> Right now, it returns the value of a given position. In that case,
> >> array_get_pos might be a better name. Oh, and I attached the patch
On 16-mrt-2010, at 17:07, Derick Rethans wrote:
> On Tue, 16 Mar 2010, Felix De Vliegher wrote:
>
>> Right now, it returns the value of a given position. In that case,
>> array_get_pos might be a better name. Oh, and I attached the patch
>> with .txt extension :)
>
> Does it also seek the arra
On Tue, Mar 16, 2010 at 17:10, David Soria Parra wrote:
> On 2010-03-16, Derick Rethans wrote:
>> - Declare 5.2 security fixes only (Something for Ilia to declare).
>> - Declare 5.3 bug fixes only (and ini-mini features if so desired)
>> (Something for Johannes to declare).
>>
>> Once that's do
On Tue, 16 Mar 2010, Alexey Zakhlestin wrote:
> On Tue, Mar 16, 2010 at 6:58 PM, Derick Rethans
> wrote:
>
> > Right now, there are the following features that I can see we should
> > think about:
> >
> > - the new output buffering mechanism (I can not really see why we would
> > not want this
On Tue, Mar 16, 2010 at 2:12 PM, Christian Schneider
wrote
> I thinks the user space implementation
>
> function array_seek($array, $pos)
> {
> $a = array_values($array);
> return $a[$pos];
> }
>
> is simple enough to not add a native function for this.
>
> It might not be the most e
On Tue, Mar 16, 2010 at 6:58 PM, Derick Rethans wrote:
> Right now, there are the following features that I can see we should
> think about:
>
> - the new output buffering mechanism (I can not really see why we would
> not want this)
> - Scott's big number improvements. Scott, can you explain (i
On 2010-03-16, Derick Rethans wrote:
> - Declare 5.2 security fixes only (Something for Ilia to declare).
> - Declare 5.3 bug fixes only (and ini-mini features if so desired)
> (Something for Johannes to declare).
>
> Once that's done, I'd like to:
>
> - Recreate trunk from the 5.3 branch.
>
>
On Tue, 16 Mar 2010, Felix De Vliegher wrote:
> Right now, it returns the value of a given position. In that case,
> array_get_pos might be a better name. Oh, and I attached the patch
> with .txt extension :)
Does it also seek the array pointer? Because I think array_seek that
moves the pointe
Hello,
I've just renamed the 5.4 branch to THE_5_4_THAT_ISNT_5_4 and moved
trunk to the branch FIRST_UNICODE_IMPLEMENTATION.
The next things to do is to re-create trunk from PHP 5.3; I've hold off
that for now, but I'd like to do the following soon:
- Declare 5.2 security fixes only (Something
On Tue, Mar 16, 2010 at 16:45, Derick Rethans wrote:
> derick Tue, 16 Mar 2010 15:45:24 +
>
> Revision: http://svn.php.net/viewvc?view=revision&revision=296284
>
> Log:
> - Moved the Unicode experiment from trunk to its own branch for reference.
>
> Changed pa
Felix De Vliegher wrote:
> Hi all
>
> I recently needed seek functionality in arrays, and couldn't find it
> in the regular set of array functions, so I wrote a function for it.
> Seek = getting an array value based on the position (or offset, if you
> want to call it like that), and not the key o
On 2010-03-13, Lukas Kahwe Smith wrote:
> +1
>
> As for the exact features to merge, lets first start with formulating a plan
> about what we want to see in the next release. I also think it makes sense to
> base the number and scope if the features on a rough idea of when we want to
> see this
On 16 March 2010 13:30, Felix De Vliegher wrote:
> Hi all
>
> I recently needed seek functionality in arrays, and couldn't find it in the
> regular set of array functions, so I wrote a function for it. (Seek = getting
> an array value based on the position (or offset, if you want to call it like
Hi Pierre
Right now, it returns the value of a given position. In that case,
array_get_pos might be a better name. Oh, and I attached the patch with .txt
extension :)
Greetings,
Felix
Index: ext/standard/array.c
===
--- ext/standa
hi Felix,
Not sure about the usefulness of this function but the name is
misleading (pls reattach the patch as .txt while being at it :). Does
it set the position (_seek) or does it return the value of a given
position (_get_pos)? or both (no idea :)?
Cheers,
Cheers,
On Tue, Mar 16, 2010 at 2:3
Hi all
I recently needed seek functionality in arrays, and couldn't find it in the
regular set of array functions, so I wrote a function for it. (Seek = getting
an array value based on the position (or offset, if you want to call it like
that), and not the key of the item)
Basically you can us
dreamcat four wrote:
On Tue, Mar 16, 2010 at 8:30 AM, Lester Caine wrote:
'3' is not a very processor friendly number, so working with 4 even though
wasteful on memory, does make perfect sense. How long is it since we had a
640k limit on working memory? SERVERS should have a good amount of memo
On 16.03.2010, at 10:46, John wrote:
> Hello, people. I am looking for community feedback about my
> ideas for XML binding & persistence library:
>
Are you thinking about implementing it as some kind of extension? or about
php-code?
or just reusable C-library with bindings for PHP?
--
PHP Int
On Tue, Mar 16, 2010 at 8:30 AM, Lester Caine wrote:
> '3' is not a very processor friendly number, so working with 4 even though
> wasteful on memory, does make perfect sense. How long is it since we had a
> 640k limit on working memory? SERVERS should have a good amount of memory
> for caching i
Hello, people. I am looking for community feedback about my
ideas for XML binding & persistence library:
XML binding & persistence library
Description: object-oriented library for mapping XML file
structure, binding to PHP 5 class. Library would provide
functionality for using XML based entity
Stanislav Malyshev wrote:
Hi!
What I am probably asking is what was the brick wall PHP6 hit. I was
under the impression that there was no agreement on 'switchable or only'
to unicode core? ( And those who did write PHP6 books seemed to have
their own views on which way the discussions would go
52 matches
Mail list logo