PHP 5 Beta 2 RC1

php.internals

Andi Gutmans

22 years ago
Hey, I've rolled RC1 of beta 2. Although it's a beta I thought it'd be a good idea to roll an RC so that we can at least do a sanity check to see that the package is OK and builds. http://www.php.net/~andi/php-5.0.0b2RC1.tar.bz2 http://www.php.net/~andi/php-5.0.0b2RC1.tar.gz Please let me know both if it works for you and if it fails. Most changes in the engine are documented in the ZEND_CHANGES file. I'll try and make sure it's updated even further for the real beta 2 release this coming week. Thanks, Andi

George Schlossnagle

22 years ago
On Friday, October 24, 2003, at 10:06 AM, Andi Gutmans wrote:
> Hey, > > I've rolled RC1 of beta 2. Although it's a beta I thought it'd be a > good idea to roll an RC so that we can at least do a sanity check to > see that the package is OK and builds. > > http://www.php.net/~andi/php-5.0.0b2RC1.tar.bz2 > http://www.php.net/~andi/php-5.0.0b2RC1.tar.gz > > Please let me know both if it works for you and if it fails. Most > changes in the engine are documented in the ZEND_CHANGES file. I'll > try and make sure it's updated even further for the real beta 2 > release this coming week.
How do you make this work without libxml2 (Sterling??)? That's an utter pain to get built on os x. George

Adam Maccabee Trachtenberg

22 years ago
On Sat, 25 Oct 2003, George Schlossnagle wrote:
> How do you make this work without libxml2 (Sterling??)? That's an > utter pain to get built on os x.
FWIW, I've had good success using fink to install libxml2 and libxsl; however, in order to get a version of libxml2 high enough (2.5.10) to work with PHP, you need to build from the "unstable" tree. -adam
-- adam@trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today!

George Schlossnagle

22 years ago
On Friday, October 24, 2003, at 11:49 AM, Adam Maccabee Trachtenberg wrote:
> On Sat, 25 Oct 2003, George Schlossnagle wrote: > >> How do you make this work without libxml2 (Sterling??)? That's an >> utter pain to get built on os x. > > FWIW, I've had good success using fink to install libxml2 and libxsl; > however, in order to get a version of libxml2 high enough (2.5.10) to > work with PHP, you need to build from the "unstable" tree.
That wasn't quite my point, I should have been more clear. I have libxml2 on my box. It was a pain to build. Supposedly, it is possible to disable the need for xml on the system, however if I uninstall libxml2 and run ./configure --disable-xml --disable-simplexml --disable-libxml , it errors out because it can't find xml2-config. Which seems to go against the spirit of those flags as I understand them. George

Jani Taskinen

22 years ago
On Sat, 25 Oct 2003, George Schlossnagle wrote:
>That wasn't quite my point, I should have been more clear. I have >libxml2 on my box. It was a pain to build. Supposedly, it is possible >to disable the need for xml on the system, however if I uninstall >libxml2 and run > >./configure --disable-xml --disable-simplexml --disable-libxml
You missed '--disable-dom' here. I'll look into making '--disable-libxml' to work as you would expect it to work..in couple of weeks. --Jani

Unnamed Person

22 years ago
When configuring PHP 5 for Mac OS X, I get this every time, even with 2.5.10 installed: not found configure: error: Please reinstall the libxml >= 2.4.14 distribution What is the deal?

Andi Gutmans

22 years ago
At 11:53 AM 10/25/2003 -0700, George Schlossnagle wrote:
>On Friday, October 24, 2003, at 11:49 AM, Adam Maccabee Trachtenberg wrote: > >>On Sat, 25 Oct 2003, George Schlossnagle wrote: >> >>>How do you make this work without libxml2 (Sterling??)? That's an >>>utter pain to get built on os x. >> >>FWIW, I've had good success using fink to install libxml2 and libxsl; >>however, in order to get a version of libxml2 high enough (2.5.10) to >>work with PHP, you need to build from the "unstable" tree. > >That wasn't quite my point, I should have been more clear. I have libxml2 >on my box. It was a pain to build. Supposedly, it is possible to disable >the need for xml on the system, however if I uninstall libxml2 and run > >./configure --disable-xml --disable-simplexml --disable-libxml > >, it errors out because it can't find xml2-config. Which seems to go >against the spirit of those flags as I understand them.
I also had some problems a couple of months ago building PHP without XML. Can someone who knows configure well see what the problem is? Andi

Dan Kalowsky

22 years ago
On Fri, 24 Oct 2003, Adam Maccabee Trachtenberg wrote:
> FWIW, I've had good success using fink to install libxml2 and libxsl; > however, in order to get a version of libxml2 high enough (2.5.10) to > work with PHP, you need to build from the "unstable" tree.
Great, just what I want, yet another external dependency. I fought originally not to depend upon Fink for PHP, and don't really see this as a solution. I'd like to ask that before we continue to roll out RC's and further Beta's that this issue gets solved. It's not only frustrating as a developer, it's also frustrating as an end user (to which my INBOX is a nice testament towards).
>---------------------------------------------------------------<
Dan Kalowsky "I thought you died alone, http://www.deadmime.org/~dank a long long time ago." dank-nom@aps-deadmime.org - "The Man Who Sold the World" kalowsky@php.net David Bowie

Ilia A.

22 years ago
External dependencies are frustrating, but you could always disable compilation of all the xml extensions (I do that all the time). That said, do we really need just about every XML extension enabled by default and if we do, perhaps a 'global' --disable-all-xml flag should be in order? Ilia

Adam Maccabee Trachtenberg

22 years ago
On Fri, 24 Oct 2003, Ilia Alshanetsky wrote:
> External dependencies are frustrating, but you could always disable > compilation of all the xml extensions (I do that all the time). That said, do > we really need just about every XML extension enabled by default and if we > do, perhaps a 'global' --disable-all-xml flag should be in order?
That sounds like a great idea. Also, George was saying that he was unable to disable all the xml extensions, at least on Mac OS X. -adam
-- adam@trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today!

Ilia A.

22 years ago
On October 24, 2003 04:27 pm, Adam Maccabee Trachtenberg wrote:
> That sounds like a great idea. Also, George was saying that he was > unable to disable all the xml extensions, at least on Mac OS X.
I used --disable-all followed by a list of extensions I want to enable. This seems to work with latest CVS, perphaps this approach will work on Mac OS X as well? Ilia

Dan Kalowsky

22 years ago
Sorry, I just find it annoying that something that has worked out of the box before (compiling PHP with default settings) is now no longer able to do so easily (on my particular platform). On Fri, 24 Oct 2003, Ilia Alshanetsky wrote:
> External dependencies are frustrating, but you could always disable > compilation of all the xml extensions (I do that all the time). That said, do > we really need just about every XML extension enabled by default and if we > do, perhaps a 'global' --disable-all-xml flag should be in order? > > Ilia >
>---------------------------------------------------------------<
Dan Kalowsky "I thought you died alone, http://www.deadmime.org/~dank a long long time ago." dank-nom@aps-deadmime.org - "The Man Who Sold the World" kalowsky@php.net David Bowie

Ilia A.

22 years ago
One solution which was to bundle libxml with PHP got rejected and if my recollection is correct you agreed with that decision. IMHO that was a good decision, bundling a huge library (3.2+ megs as of 2.6.0) almost as big as PHP itself seems kind of strange. Reverting back to expat does not appear like a valid option as that prevents a common backend for all of the xml extensions. Although if someone can come up with a good solution, maybe fall back to expat if no operational libxml is found? Given xml's perceived popularity disabling XML is not an option, that and I believe (not 100% sure) it would cause problems for PEAR. IMHO the best solution would be to leave (some) XML extensions enabled by default, however if libxml cannot be found or is unusable silently disable the affected extensions. Or perhaps give a warning indicating xml extensions are disabled at the end of configure. Ilia

Greg Beaver

22 years ago
Ilia Alshanetsky wrote:
> One solution which was to bundle libxml with PHP got rejected and if my > recollection is correct you agreed with that decision. IMHO that was a good > decision, bundling a huge library (3.2+ megs as of 2.6.0) almost as big as > PHP itself seems kind of strange. > > Reverting back to expat does not appear like a valid option as that prevents a > common backend for all of the xml extensions. Although if someone can come up > with a good solution, maybe fall back to expat if no operational libxml is > found? > > Given xml's perceived popularity disabling XML is not an option, that and I > believe (not 100% sure) it would cause problems for PEAR.
I can verify this. PEAR is structured around the ability to parse a package.xml using expat-style parsing. Without xml, there is no PEAR. Regards, Greg

Rasmus Lerdorf

22 years ago
On Fri, 24 Oct 2003, Greg Beaver wrote:
> Ilia Alshanetsky wrote: > > One solution which was to bundle libxml with PHP got rejected and if my > > recollection is correct you agreed with that decision. IMHO that was a good > > decision, bundling a huge library (3.2+ megs as of 2.6.0) almost as big as > > PHP itself seems kind of strange. > > > > Reverting back to expat does not appear like a valid option as that prevents a > > common backend for all of the xml extensions. Although if someone can come up > > with a good solution, maybe fall back to expat if no operational libxml is > > found? > > > > Given xml's perceived popularity disabling XML is not an option, that and I > > believe (not 100% sure) it would cause problems for PEAR. > > I can verify this. PEAR is structured around the ability to parse a > package.xml using expat-style parsing. Without xml, there is no PEAR.
That's a bit misleading. Without XML the pear installer just runs slower since it uses a user-space xml parser. -Rasmus

Greg Beaver

22 years ago
Hello Rasmus, To quote from PEAR/Common.php's infoFromString() method (used to parse package.xml, and the base of all installation methods) $xp = @xml_parser_create(); if (!$xp) { return $this->raiseError('Unable to create XML parser'); } Regards, Greg Rasmus Lerdorf wrote:

Zeev Suraski

22 years ago
At 22:47 24/10/2003, Ilia Alshanetsky wrote:
>One solution which was to bundle libxml with PHP got rejected and if my >recollection is correct you agreed with that decision. IMHO that was a good >decision, bundling a huge library (3.2+ megs as of 2.6.0) almost as big as >PHP itself seems kind of strange.
Just for the record, it wasn't rejected at any point. We'll have at least one beta with it enabled, to see how well it works. At minimum, we'll have two packages, one w/ libxml2 and one w/o. Zeev

Andi Gutmans

22 years ago
At 03:50 PM 10/24/2003 -0400, Dan Kalowsky wrote:
>On Fri, 24 Oct 2003, Adam Maccabee Trachtenberg wrote: > > > FWIW, I've had good success using fink to install libxml2 and libxsl; > > however, in order to get a version of libxml2 high enough (2.5.10) to > > work with PHP, you need to build from the "unstable" tree. > >Great, just what I want, yet another external dependency. I fought >originally not to depend upon Fink for PHP, and don't really see this as >a solution. > >I'd like to ask that before we continue to roll out RC's and further >Beta's that this issue gets solved. It's not only frustrating as a >developer, it's also frustrating as an end user (to which my INBOX is a >nice testament towards).
This issue is definitely not a reason to stop rolling out RC's nor betas. Enabling the XML extensions by default is the right decision because this is an important technology which almost every PHP user will need. I do think it's a good idea though to have a --disable switch that works and disables all of the XML extensions. IMO, we shouldn't have --disable-simplexml and --disable-xml. We should just have the latter and make it disable/enable all the three XML extensions. There is no real reason not to enable them all. The memory consumption is minimal and once one of them is enabled libXML2 is linked. I don't see any good coming out of reverting back to expat. I think one of the most important "features'" in PHP 5 will be the much better XML support and this is really something PHP users are looking for. Andi

Adam Dickmeiss

22 years ago
Andi Gutmans wrote: [snip]
> This issue is definitely not a reason to stop rolling out RC's nor betas. > Enabling the XML extensions by default is the right decision because > this is an important technology which almost every PHP user will need. > I do think it's a good idea though to have a --disable switch that > works and disables all of the XML extensions. > IMO, we shouldn't have --disable-simplexml and --disable-xml. We > should just have the latter and make it disable/enable all the three > XML extensions. There is no real reason not to enable them all. The > memory consumption is minimal and once one of them is enabled libXML2 > is linked. > I don't see any good coming out of reverting back to expat. I think > one of the most important "features'" in PHP 5 will be the much better > XML support and this is really something PHP users are looking for.
I asked (and so did someone else) if there is support for XSLT scheme handlers in PHP5. Nobody answered. It was possible in PHP4 with Sablotron. Now the Sablotron PHP extension is gone. So IMHO a very essential XML feature is missing in PHP5. -- Adam

Steph

22 years ago
> > This issue is definitely not a reason to stop rolling out RC's nor
betas.
> > Enabling the XML extensions by default is the right decision because > > this is an important technology which almost every PHP user will
need.
> > I do think it's a good idea though to have a --disable switch that > > works and disables all of the XML extensions. > > IMO, we shouldn't have --disable-simplexml and --disable-xml. We > > should just have the latter and make it disable/enable all the three > > XML extensions. There is no real reason not to enable them all. The > > memory consumption is minimal and once one of them is enabled
libXML2
> > is linked. > > I don't see any good coming out of reverting back to expat. I think > > one of the most important "features'" in PHP 5 will be the much
better
> > XML support and this is really something PHP users are looking for. > > I asked (and so did someone else) if there is support for XSLT scheme > handlers in PHP5. Nobody answered. It was possible in PHP4 with > Sablotron. Now the Sablotron PHP extension is gone. So IMHO a very > essential XML feature is missing in PHP5.
Hear, hear.. to both of you.

George Schlossnagle

22 years ago
On Friday, October 24, 2003, at 10:06 AM, Andi Gutmans wrote:
> Hey, > > I've rolled RC1 of beta 2. Although it's a beta I thought it'd be a > good idea to roll an RC so that we can at least do a sanity check to > see that the package is OK and builds. > > http://www.php.net/~andi/php-5.0.0b2RC1.tar.bz2 > http://www.php.net/~andi/php-5.0.0b2RC1.tar.gz > > Please let me know both if it works for you and if it fails. Most > changes in the engine are documented in the ZEND_CHANGES file. I'll > try and make sure it's updated even further for the real beta 2 > release this coming week.
Only a handful of make test failures on OS X (w/libxml2): ===================================================================== FAILED TEST SUMMARY --------------------------------------------------------------------- Locale settings affecting float parsing [tests/lang/034.phpt] Bug #25547 (error_handler and array index with function call) [tests/lang/bug25547.phpt] serializing references test case using globals [ext/session/tests/019.phpt] Bug #25756 (validate_schema_file() broken) [ext/simplexml/tests/bug25756.phpt] File type functions [ext/standard/tests/file/001.phpt] Check for mktime with out-of-range parameters [ext/standard/tests/time/003.phpt] mktime() [ext/standard/tests/time/mktime.phpt] XML parser test, function callbacks [ext/xml/tests/xml001.phpt] XML parser test, object tuple callbacks [ext/xml/tests/xml002.phpt] XML parser test, xml_set_object callbacks [ext/xml/tests/xml003.phpt] =====================================================================

Ilia A.

22 years ago
> Locale settings affecting float parsing [tests/lang/034.phpt]
This fails on all MacOS installs (even with prior PHP) due to locale handling bug. MacOS claims switch locale, but does not actually do it.
> Bug #25547 (error_handler and array index with function call) > [tests/lang/bug25547.phpt]
Currently fails on PHP5, however works fine in PHP4.
> Check for mktime with out-of-range parameters > [ext/standard/tests/time/003.phpt] > mktime() [ext/standard/tests/time/mktime.phpt]
Also, a MacOSX specific issue that is not PHP5 specific. Ilia

Melvyn Sopacua

22 years ago
Hi, On Friday 24 October 2003 20:45, Ilia Alshanetsky wrote:
> > Check for mktime with out-of-range parameters > > [ext/standard/tests/time/003.phpt] > > mktime() [ext/standard/tests/time/mktime.phpt] > > Also, a MacOSX specific issue that is not PHP5 specific.
Actually - a BSD mktime specific issue and again an issue of differences in the values set for the TZ variable. I've experimented a little with TZ values and used AIX as a reference for an implementation that doesn't understand Country/City implementations. When Europe/Amsterdam is set as TZ on AIX, date('O') reports +0000 as offset - ie: it defaults to GMT. However - if CET-1CEST is used for BSD, it reports +0200 as offset - in fact it will report +0200 for any -1 value, even if the timezones surrounding are completely bogus. Using that approach we can fix the test as attached. The same applies to 002.phpt and changing detection of 'T' to 'O' makes it work for AIX as well. The only insolvable problem is with tests/time/mktime.phpt, because: * As far as BSD time is concerned: if a zone does not support DST, it will return 0 for any attempts to do so. GMT as a zone does not support DST. * If Europe/London is selected for the timezone and dst is forced, then it will indeed force it, where others don't. Patch applies to both php5 as php4. Does this work on linux correctly?
-- Melvyn

Sebastian Bergmann

22 years ago
Andi Gutmans wrote:
> Please let me know both if it works for you and if it fails.
Compiles fine on my GENTOO/Linux laptop: - gentoo-sources 2.4.20-r7 - glibc 2.3.2-r6 - gcc (GCC) 3.3.1 20030916 (Gentoo Linux 3.3.1-r4, propolice) - autoconf 2.13, libtool 1.4.3, bison 1.875, flex 2.5.4 Compiles with 49 warnings (CLI/CGI SAPIs) on Windows 2000 with MSVC 6. php4apache2.dll fails to build: php5\win32\time.h(27): error C2079: 'it_interval' uses undefined struct 'timeval' php5\win32\time.h(28): error C2079: 'it_value' uses undefined struct 'timeval' apache2\include\apr_network_io.h(250): error C2079: 'sin' uses undefined struct 'sockaddr_in' Don't know what this is about, worked until recently and I haven't changed my build environment since (at least not that I remember). php_gd2.dll fails to build: php5\ext\gd\libgd\gd_jpeg.c(442): error C2065: 'ptrdiff_t': undeclared identifier php5\ext\gd\libgd\gd_jpeg.c(442): error C2146: Syntax error: Missing ';' before identifier 'nbytes' php5\ext\gd\libgd\gd_jpeg.c(442): error C2065: 'nbytes': undeclared identifier
-- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/

Andi Gutmans

22 years ago
At 05:57 PM 10/25/2003 +0200, Sebastian Bergmann wrote:
> php_gd2.dll fails to build: > > php5\ext\gd\libgd\gd_jpeg.c(442): error C2065: > 'ptrdiff_t': undeclared identifier > > php5\ext\gd\libgd\gd_jpeg.c(442): error C2146: > Syntax error: Missing ';' before identifier 'nbytes' > > php5\ext\gd\libgd\gd_jpeg.c(442): error C2065: > 'nbytes': undeclared identifier
Can you check if PHP_WIN32 is defined in Project->Settings->C/C++->Preprocessor? No idea about Apache 2. Thanks, Andi

George Schlossnagle

22 years ago
Weird bug in simplexml: The following code loops indefinitely. $conf = simplexml_load_file("status.xml"); foreach($conf->services->service as $service) { print $service->params->description."\n"; foreach($service->params as $foo) { print "$foo\n"; } } #status.xml <config> <loggers> <logger> <id>errorlog</id> <class>ErrorLog_ServiceLogger</class> </logger> </loggers> <services> <service> <class>HTTP_ServiceCheck</class> <params> <description>OmniTI HTTP Check</description> <uri>http://www.omniti.com</uri> <timeout>30</timeout> </params> <loggers> <logger>errorlog</logger> <logger>debuglog</logger> </loggers> </service> <service> <class>HTTP_ServiceCheck</class> <params> <description>SCHLOSSNAGLE.ORG HTTP Check</description> <uri>http://www.schlossnagle.org</uri> <timeout>30</timeout> </params> <loggers> <logger>errorlog</logger> <logger>debuglog</logger> </loggers> </service> </services> </config> On Friday, October 24, 2003, at 01:06 PM, Andi Gutmans wrote:
> Hey, > > I've rolled RC1 of beta 2. Although it's a beta I thought it'd be a > good idea to roll an RC so that we can at least do a sanity check to > see that the package is OK and builds. > > http://www.php.net/~andi/php-5.0.0b2RC1.tar.bz2 > http://www.php.net/~andi/php-5.0.0b2RC1.tar.gz > > Please let me know both if it works for you and if it fails. Most > changes in the engine are documented in the ZEND_CHANGES file. I'll > try and make sure it's updated even further for the real beta 2 > release this coming week. > > Thanks, > Andi > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >
-- George Schlossnagle -- Principal Consultant -- OmniTI Computer Consulting, Inc. -- +1.410.872.4910 x202 -- 1024D/1100A5A0 1370 F70A 9365 96C9 2F5E 56C2 B2B9 262F 1100 A5A0

Rob Richards

22 years ago
Works fine from CVS. This was most likely fixed with the iterator stuff from Marcus. Rob From: George Schlossnagle

Marcus Börger

22 years ago
Hello Robert, George, yes, the simplexml/foreach was borked before and can be considered fixed now. marcus Monday, October 27, 2003, 2:03:24 AM, you wrote:
> Works fine from CVS. This was most likely fixed with the iterator stuff from > Marcus.
> Rob
> From: George Schlossnagle >> The following code loops indefinitely. >> >> $conf = simplexml_load_file("status.xml"); >> foreach($conf->services->service as $service) { >> print $service->params->description."\n"; >> foreach($service->params as $foo) { >> print "$foo\n"; >> } >> }
-- Best regards, Marcus mailto:helly@php.net

George Schlossnagle

22 years ago
There's also an auto-casting issue. If you have something like: $xml = simplexml_load_file("a.xml"); print_r($xml); foreach($xml->book as $book) { $arr[$book] = 1; } <books> <book>foo</book> <book>bar</book> </books> you get an illegal offset error in the assignment to $arr. It's attempting to use it as a simpleXML object. If you instead do: $xml = simplexml_load_file("a.xml"); print_r($xml); foreach($xml->book as $book) { $arr["$book"] = 1; } It works fine. On Monday, October 27, 2003, at 01:47 AM, Marcus BXrger wrote:
> Hello Robert, George, > > yes, the simplexml/foreach was borked before and can be considered > fixed > now. > > marcus > > Monday, October 27, 2003, 2:03:24 AM, you wrote: > >> Works fine from CVS. This was most likely fixed with the iterator >> stuff from >> Marcus. > >> Rob > >> From: George Schlossnagle >>> The following code loops indefinitely. >>> >>> $conf = simplexml_load_file("status.xml"); >>> foreach($conf->services->service as $service) { >>> print $service->params->description."\n"; >>> foreach($service->params as $foo) { >>> print "$foo\n"; >>> } >>> } > > > > > -- > Best regards, > Marcus mailto:helly@php.net > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >
-- George Schlossnagle -- Principal Consultant -- OmniTI Computer Consulting, Inc. -- +1.410.872.4910 x202 -- 1024D/1100A5A0 1370 F70A 9365 96C9 2F5E 56C2 B2B9 262F 1100 A5A0

Marcus Börger

22 years ago
Hello George, intersting code :-) You can also avoid that by using $arr[(string)$book] = 1; instead of $arr["$book"] = 1; marcus Monday, October 27, 2003, 8:08:28 AM, you wrote:
> There's also an auto-casting issue. If you have something like:
> $xml = simplexml_load_file("a.xml"); > print_r($xml); > foreach($xml->book as $book) { > $arr[$book] = 1; > }
> <books> > <book>foo</book> > <book>bar</book> > </books>
> you get an illegal offset error in the assignment to $arr. It's > attempting to use it as a simpleXML object.
> If you instead do:
> $xml = simplexml_load_file("a.xml"); > print_r($xml); > foreach($xml->book as $book) { > $arr["$book"] = 1; > }
> It works fine.
> On Monday, October 27, 2003, at 01:47 AM, Marcus BXrger wrote:
>> Hello Robert, George, >> >> yes, the simplexml/foreach was borked before and can be considered >> fixed >> now. >> >> marcus >> >> Monday, October 27, 2003, 2:03:24 AM, you wrote: >> >>> Works fine from CVS. This was most likely fixed with the iterator >>> stuff from >>> Marcus. >> >>> Rob >> >>> From: George Schlossnagle >>>> The following code loops indefinitely. >>>> >>>> $conf = simplexml_load_file("status.xml"); >>>> foreach($conf->services->service as $service) { >>>> print $service->params->description."\n"; >>>> foreach($service->params as $foo) { >>>> print "$foo\n"; >>>> } >>>> } >> >> >> >> >> -- >> Best regards, >> Marcus mailto:helly@php.net >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > -- George Schlossnagle > -- Principal Consultant > -- OmniTI Computer Consulting, Inc. > -- +1.410.872.4910 x202 > -- 1024D/1100A5A0 1370 F70A 9365 96C9 2F5E 56C2 B2B9 262F 1100 A5A0
-- Best regards, Marcus mailto:helly@php.net

George Schlossnagle

22 years ago
On Monday, October 27, 2003, at 02:22 AM, Marcus BXrger wrote:
> Hello George, > > intersting code :-) > > You can also avoid that by using > $arr[(string)$book] = 1; > instead of > $arr["$book"] = 1; > > marcus
Yeah, I know I can avoid it, but I shouldn't have to. In more complex examples it also seems to cause SIGBUS errors on OSX. An ickier example would be something like this <params> <description>Home Page HTTP Check</description> <url>http://www.schlossnagle.org/~george</url> <timeout>30</timeout> <frequency>900</frequency </params> parsed by something like this public function __construct($params) { foreach($params as $k => $v) { $k = "$k"; $this->$k = "$v"; } } That has really high WTF factor.