Adam Maccabee Trachtenberg | 1 Feb 01:27 2004

Re: [PHP-DEV] SimpleXML->children() and text nodes

On Sun, 1 Feb 2004, Derick Rethans wrote:

> when I iterate over $s->body->children() I only get the <element/> and
> the <baz/>. Shouldn't it also show the text nodes?

I hestitate to get back into this discussion, but I will give you the
answers as best I can. :)

The SimpleXML model prefers you to not mix element and text nodes
side-by-side. You can, and it won't complain, but (IMHO) the theory is
that an element should either contain other elements or a single text
(or CDATA) node. This is a more "XML-centric" viewpoint towards data
than an "HTML-centric" perspective. (Realize these are generalizations
here about the nature of XML and HTML.)

If you're interested in accessing the XML inside $sx->body, you can
either call $sx->body->asXML(), which will give it to you as a string,
or use DOM. :)

> Another thing that would be useful to have is a tag() method, so that
> this would work too: (ie, I can check what tag I got during iteration).
>
> <?php
>   foreach ($sx->body->children() as $node) {
>     if ($node->tag() == 'element') {
>       /* do this */
>     }
>   }
> ?>
>
(Continue reading)

Georg Richter | 1 Feb 07:50 2004
Picon
Picon

[PHP-DEV] PHP5: bcmath

Hi,

after discussion with Brian Aker about problems with number precision in 
financial applications and thinking about the impact of "Enterprise" I'm 
wondering that bcmath is not enabled by default. 

Is there a reason for it? if not I'm strongly +1 to enable it by default.

Georg

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Sebastian Bergmann | 1 Feb 07:57 2004
Picon
Picon

Re: [PHP-DEV] PHP5: bcmath

Georg Richter wrote:
> Is there a reason for it? if not I'm strongly +1 to enable it by
> default.

  +1 (it's been enabled by default on Windows for ages)

-- 
Sebastian Bergmann
http://sebastian-bergmann.de/                   http://phpOpenTracker.de/

Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Ilia Alshanetsky | 1 Feb 08:04 2004

Re: [PHP-DEV] Warnings in include files suddenly treated as fatal

The basic problem is as follows. If you have a parse error inside an included 
or required file, the execution stops just for that file and continues for 
the main script. The result is that normally a fatal (parse) error becomes a 
warning. Consequently, it may result in undefined behavior since whatever 
code was inside the included file was not entirely parsed and executed.

Ilia

On January 31, 2004 04:17 pm, you wrote:
> I think I missed out on the original problem. What does the fix, fix? Isn't
> a parse error automatically a fatal error?
> If you revert your patch what won't work?
> Andi
>
> At 09:59 AM 1/30/2004 -0500, Ilia Alshanetsky wrote:
> >It seems like the only way to distinguish between a parse error and a
> >non-existant file for regular include() is by doing a zend_stream_open()
> > upon failure to determine if the file is avaliable. If it is, then we
> > return a parse error and if it does not we continue execution. This does
> > add a small overhead for failed includes, but IMHO if a non-existant
> > files are being included performance is not a big consideration.
> >
> >That said, if there is much opposition to the approach I would be happy to
> >revert the code to the previous state.
> >
> >Ilia
> >
> >P.S. Suggested 'fix' is attached.
> >
> >On January 30, 2004 05:29 am, Rasmus Lerdorf wrote:
(Continue reading)

Ilia Alshanetsky | 1 Feb 08:07 2004

Re: [PHP-DEV] PHP5: bcmath

Majority of PHP application and hence users do not require this extension. 
Those who do, in most cases operate in an environment where they have full 
control over their PHP configuration and thus will be able to enable this 
extension on demand.

-1.

Ilia

On February 01, 2004 01:50 am, Georg Richter wrote:
> Hi,
>
> after discussion with Brian Aker about problems with number precision in
> financial applications and thinking about the impact of "Enterprise" I'm
> wondering that bcmath is not enabled by default.
>
> Is there a reason for it? if not I'm strongly +1 to enable it by default.
>
> Georg

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Pierre-Alain Joye | 1 Feb 10:02 2004

Re: [PHP-DEV] PHP5: bcmath

On Sun, 1 Feb 2004 07:50:45 +0100
Georg Richter <georg <at> php.net> wrote:

> Hi,
> 
> after discussion with Brian Aker about problems with number precision
> in financial applications and thinking about the impact of
> "Enterprise" I'm wondering that bcmath is not enabled by default. 
> 
> Is there a reason for it? if not I'm strongly +1 to enable it by
> default.

+1 here.
Another good reason is to check the bug reports where "bogus->Use
bcmath" has been applied.

pierre

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Andi Gutmans | 1 Feb 10:06 2004

Re: [PHP-DEV] PHP5: bcmath

At 07:50 AM 2/1/2004 +0100, Georg Richter wrote:
>Hi,
>
>after discussion with Brian Aker about problems with number precision in
>financial applications and thinking about the impact of "Enterprise" I'm
>wondering that bcmath is not enabled by default.
>
>Is there a reason for it? if not I'm strongly +1 to enable it by default.

I wouldn't mind.
Andi

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Stanislav Malyshev | 1 Feb 10:09 2004

Re: [PHP-DEV] PHP5: bcmath

AG>> >financial applications and thinking about the impact of "Enterprise" I'm
AG>> >wondering that bcmath is not enabled by default.
AG>> >
AG>> >Is there a reason for it? if not I'm strongly +1 to enable it by default.
AG>> 
AG>> I wouldn't mind.

From what I remember, GMP module is superior to bcmath and works 
good, however I have seen problems with bcmath not working in certain 
situations. GMP is LGPL, I don't know if it matters.
-- 
Stanislav Malyshev, Zend Products Engineer   
stas <at> zend.com  http://www.zend.com/ +972-3-6139665 ext.109

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Norbert Mocsnik | 1 Feb 10:47 2004
Picon

[PHP-DEV] CVS Account Request: norbert_m

Committing the hungarian translation of the PEAR manual.

/peardoc/hu/

Martin Jansen wrote:
> Do you already have a CVS account for cvs.php.net? You'll need one in order to commit the XML sources into
the CVS repository.

Please send me back the password if possible, for later reference. Thanks.

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Tobias Bradtke | 1 Feb 10:57 2004
Picon

[PHP-DEV] Re: SimpleXML->children() and text nodes

Derick Rethans wrote:

> Another thing that would be useful to have is a tag() method, so that
> this would work too: (ie, I can check what tag I got during iteration).
> 
> <?php
>   foreach ($sx->body->children() as $node) {
>     if ($node->tag() == 'element') {
>       /* do this */
>     }
>   }
> ?>
> 
> or can I do that in a different way now?

this works:

foreach ($sxe->body as $node) {
  if (dom_import_simplexml($node)->tagName == 'element') {
    echo "element";
    }
  }

but i don't know how much overhead the conversion from simplexml to dom
takes..

webwurst

--

-- 
PHP Internals - PHP Runtime Development Mailing List
(Continue reading)


Gmane