In the hopes of moving the discussion forward, I'm going to try and
sum up general consensus. I believe we agree on most issues, so
hopefully it should be easy to come up with the next steps we should
take with SimpleXML.
I know it's late in the PHP 5 process, but I feel that SimpleXML was
On Tue, 13 Jan 2004, Andi Gutmans wrote:
At 07:39 AM 1/13/2004 +0100, Marcus Boerger wrote:
It's not supposed to be DOM but I think there's a lot of added value in
making it easy/simple to do some of the basic methods. I agree it shouldn't
be bloated with all of DOM's capabilities.
I
I pretty much agree with most of this. I am +1 on moving forward and
reaching a plan and implementation ASAP.
I agree with Sterling that we should keep things simple and slim. This will
also allows us to regret this decision in the future and add more
functionality. As I said previously, I
From: Adam Maccabee Trachtenberg
1) SimpleXML creates PHP data structures from XML documents. It only
handles XML elements, attributes, and text nodes. The syntax for
accessing the text node children of an element is akin to object
properties ($foo-bar); the syntax of accessing
Rob Richards wrote:
From: Adam Maccabee Trachtenberg
accessing the text node children of an element is akin to object
properties ($foo-bar); the syntax of accessing attributes is akin
to array elements ($foo['bar']).
Hmm... This is somewhat up-side-down language wise. Attributes are
At 14:33 13/01/2004, Rob Richards wrote:
From: Adam Maccabee Trachtenberg
1) SimpleXML creates PHP data structures from XML documents. It only
handles XML elements, attributes, and text nodes. The syntax for
accessing the text node children of an element is akin to object
properties
On Jan 13, 2004, at 7:33 AM, Rob Richards wrote:
From: Adam Maccabee Trachtenberg
1) SimpleXML creates PHP data structures from XML documents. It only
handles XML elements, attributes, and text nodes. The syntax for
accessing the text node children of an element is akin to object
On Jan 13, 2004, at 9:21 AM, Christian Schneider wrote:
But let's take a look on how I'd use it (xml formatted for
readability):
$foo = simplexml_load_string('
foo x:a=xa y:a=ya
ab
foo2foo2a/foo2
cd
foo2foo2b/foo2
ef
foo3
foo3
foo4foo4/foo4
foo3
/foo3
gh
/foo');
Ugh. This
On Tue, 13 Jan 2004, Adam Trachtenberg wrote:
Here are my thoughts on solutions:
1) Place all elements in an array (or nodeList) regardless whether
there's 0, 1, or many. This is the DOM solution. This just leads to
annoying code where you need to do $foo-item(0) and $foo-firstChild.
Adam Trachtenberg wrote:
Ugh. This is pretty much the limit of what I think is reasonable for
SimpleXML to handle. It think the API would be more consistent if the
Agreed. I was just curious how it behaves if I push it to the limit :-)
However, I don't really see any way around this otherwise.
On Tue, 13 Jan 2004, Christian Schneider wrote:
Adam Trachtenberg wrote:
However, I don't really see any way around this otherwise. Either it's
general or not. It can't be both. (Unless there's some magical type
that's both an array and a scalar.) I'm willing to put up with this
Adam Maccabee Trachtenberg wrote:
Don't do that. Use the schema. :)
Is that why it's called SimpleXML? ;-)
I don't think one should force people to use schemata for now.
Unless, of course, you're not in control over those documents.
You can simply wrap it when passing it to SimpleXML, e.g.
From: Adam Maccabee Trachtenberg
1) SimpleXML creates PHP data structures from XML documents. It only
handles XML elements, attributes, and text nodes. The syntax for
accessing the text node children of an element is akin to object
properties ($foo-bar); the syntax of accessing
On Tue, 13 Jan 2004, Marcus Boerger wrote:
The problem here are virtual properties that are not stored via a hashtable
in the object. The problem (of course) is that the read (RW) handler creates
a temp container for the property value. As a consequence the changed value
needs to be written
On Tue, 13 Jan 2004, Adam Maccabee Trachtenberg wrote:
If we can get a couple +1s on this, I would then like to move onto the
next steps which would be deciding which functions will be in the
initial release, what their prototypes are, and who should implement
what and by when.
+1.
-Andrei
Hey,
I've attached a fix for an engine level crash in switch() when it is
used with string offsets. This eliminates a double-free and valgrind
reports that no new leaks have been introduced.
-Sterling
Index: zend_execute.c
===
RCS
Hi internals,
I know HEAD is freezed, but anyway to ask
whether a new function in_array_all() can be added.
It works like in_array() but checks whether all needles
are in the stack array.
Diff : http://www.hristov.com/andrey/projects/php_stuff/in_array_all.diff.txt
Best wishes,
Andrey
--
PHP
Are you sure this is OK? It seems strange that string offsets don't need
any unlocking. It might mean we have a problem someplace else and that
you're fixing the cause and not the source of the problem (although I
haven't had time to dig deep).
In general, consider the following code:
$a = Foo;
Are you sure this is OK? It seems strange that string offsets don't need
any unlocking. It might mean we have a problem someplace else and that
you're fixing the cause and not the source of the problem (although I
haven't had time to dig deep).
In general, consider the following code:
$a
At 04:06 PM 1/13/2004 -0500, Sterling Hughes wrote:
Are you sure this is OK? It seems strange that string offsets don't need
any unlocking. It might mean we have a problem someplace else and that
you're fixing the cause and not the source of the problem (although I
haven't had time to dig
On Tue, 13 Jan 2004, Andrey Hristov wrote:
I know HEAD is freezed, but anyway to ask whether a new function
in_array_all() can be added. It works like in_array() but checks
whether all needles are in the stack array.
Do we really need this either way?
function in_array_all($needles,
Andrey Hristov wrote:
It works like in_array() but checks whether all needles
are in the stack array.
Looking at the prototype:
bool in_array_all(mixed needle1[, mixed needle2], mixed haystack [, bool
strict])
I'd say if (and I'm personally -1) this is added it should be
bool in_array_all(array
Andrey Hristov wrote:
Hi internals,
I know HEAD is freezed, but anyway to ask
whether a new function in_array_all() can be added.
It works like in_array() but checks whether all needles
are in the stack array.
Diff :
http://www.hristov.com/andrey/projects/php_stuff/in_array_all.diff.txt
Best
On Tue, 13 Jan 2004, Andrey Hristov wrote:
Hi internals,
I know HEAD is freezed, but anyway to ask
whether a new function in_array_all() can be added.
It works like in_array() but checks whether all needles
are in the stack array.
Diff :
Hi Christian,
Christian Schneider wrote:
Andrey Hristov wrote:
It works like in_array() but checks whether all needles
are in the stack array.
Looking at the prototype:
bool in_array_all(mixed needle1[, mixed needle2], mixed haystack [, bool
strict])
I'd say if (and I'm personally -1) this
Hi,
just a correction, I meant array_diff when i wrote array_intersect.
array_diff is more handy since just count($res)==0 is enough, $res is the
returned array of array_diff().
Andrey
Andrey Hristov wrote:
So, I did now some testing. Looks like in_array_all() is 6x faster than
array_intersect()
On Tue, 13 Jan 2004, Andrey Hristov wrote:
Hi,
just a correction, I meant array_diff when i wrote array_intersect.
array_diff is more handy since just count($res)==0 is enough, $res is the
returned array of array_diff().
Did you actually try array_intersect()?
- Andrei
--
PHP Internals -
Hi Andrei :)
Andrei Zmievski wrote:
On Tue, 13 Jan 2004, Andrey Hristov wrote:
Hi,
just a correction, I meant array_diff when i wrote array_intersect.
array_diff is more handy since just count($res)==0 is enough, $res is the
returned array of array_diff().
Did you actually try
Ok, attached is a diff that properly fixes the problem.
-Sterling
At 04:06 PM 1/13/2004 -0500, Sterling Hughes wrote:
Are you sure this is OK? It seems strange that string offsets don't need
any unlocking. It might mean we have a problem someplace else and that
you're fixing the cause and
Hi Andrey,
My personal feeling is that not enough people use this to make the pure
speed improvement worth a new function. I guess the list will decide...
- Chris
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
I'm looking to update the libical extension I wrote awhile back to
use the new features of ZE2 in PHP5 (libical has been written in
such a manner that the features of ZE2 are an excellent match to
libical's interface). I've been looking over the
default exception class in
Hi,
I didn't write this function to be faster. You asked about array_intersect()
and I decided to bechmark (you didn't ask for it though). What I had in mind
when I decided to write it was to escape this :
if (in_array(some_element, $haystack) in_array(other_element, $haystack)
32 matches
Mail list logo