Re: [PHP-DEV] PROPOSAL: temp stream for post_data

2013-09-16 Thread Gustavo Lopes
On Mon, 16 Sep 2013 09:01:02 +0200, Michael Wallner wrote: On 10 September 2013 13:29, Michael Wallner wrote: On 28 August 2013 08:14, Michael Wallner wrote: On 27 August 2013 23:17, Gustavo Lopes wrote: I think it's generally a good idea, but I have some concerns: ... Fixed

Re: [PHP-DEV] [RFC] Named parameters

2013-09-07 Thread Gustavo Lopes
On 06-09-2013 23:54, Nikita Popov wrote: On Fri, Sep 6, 2013 at 11:23 PM, Gustavo Lopes wrote: I think the correct course of action is just to drop support for extra named arguments. Just add an extra array argument to the function and you have equivalent functionality without having to go

Re: [PHP-DEV] [RFC] Named parameters

2013-09-06 Thread Gustavo Lopes
ers with the default arguments), this would ease the implementation and the transition, especially for userland code. Regards -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] PROPOSAL: temp stream for post_data

2013-08-27 Thread Gustavo Lopes
or a void* (though this would break taking a pointer). -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] New handler for retrieving properties when object is serialized

2013-07-26 Thread Gustavo Lopes
e data for serialization. I think not using PHP_VAR_SERIALIZE_INIT() would always be an error in the extension anyway. However, you are right this method is not "nice" by any means. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] New handler for retrieving properties when object is serialized

2013-07-26 Thread Gustavo Lopes
large API with yet another way of doing something for edge cases for which we have a good solution for the general case already. Alternatively, could the problem perhaps be mitigated by making available some utility functions for serializing native types? -- Gustavo Lopes -- PHP Internal

Re: [PHP-DEV] New handler for retrieving properties when object is serialized

2013-07-25 Thread Gustavo Lopes
get_properties instead of keeping adding these. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: PHP 5.5.1 released

2013-07-19 Thread Gustavo Lopes
binaries in http://pecl.php.net/package/intl with ICU 51 with no problem and the codebase is very similar to that of ext/intl. But if you did find a bug, please report it. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net

[PHP-DEV] Re: IntlTimeZone::getOffset?

2013-06-30 Thread Gustavo Lopes
that would advise against such a change -- namely, it's in a stable release. At this point, the reliance interest is small because 5.5.0 (and intl v3) has been out for little time, but perhaps, if anything is to be done, other options such as introducing an object type just for encapsulating

[PHP-DEV] Re: IntlTimeZone::getOffset?

2013-06-30 Thread Gustavo Lopes
amp is the UTC timestamp that would yield the same UTC date/time as the local wall time at issue. This has the usual problems at DST transitions, see this comment: http://lxr.php.net/xref/THIRD_PARTY/ICU4C/source/i18n/timezone.cpp#661 -- Gustavo Lopes -- PHP Internals - PHP Runtime De

Re: [PHP-DEV] ENT_ALL or similar option for htmlspecialchars[_decode]?

2013-06-27 Thread Gustavo Lopes
of that of a dedicated algorithm, though. And it only supports UTF-8. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: #53437

2013-06-07 Thread Gustavo Lopes
something exotic as an array cast (which anyway has its own peculiarities wrt the key type conversion -- or the absence of it). -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: strtr() performance degradation

2013-06-04 Thread Gustavo Lopes
s, but falling back to it in those cases is always an option. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: strtr() performance degradation

2013-06-04 Thread Gustavo Lopes
heaper. It will require some experimentation in order to determine the cutoff, but if you think it's important I can do it (you're welcome to do it as well). Regards -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] how to determine errno on user space?

2013-04-03 Thread Gustavo Lopes
classes for this purpose is unprecedented in the PHP codebase. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Fix for bug #63437

2013-03-09 Thread Gustavo Lopes
ing stored, so you can share the serialized data between machines with different endianness. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] NEWS file rename

2013-03-03 Thread Gustavo Lopes
How does that fix anything? You'll still have a conflict because you'll be changing a file that doesn't exist in the other branch. Besides, the solution is well documented on the wiki: https://wiki.php.net/vcs/gitfaq#mandatory_git_settings -- Gustavo Lopes -- PHP Int

Re: [PHP-DEV] [RFC] send/recvmsg() wrappers in ext/socket

2013-02-21 Thread Gustavo Lopes
Em 2013-02-21 4:06, Ferenc Kovacs escreveu: On Tue, Jan 22, 2013 at 6:23 PM, Gustavo Lopes wrote: https://wiki.php.net/rfc/**sendrecvmsg<https://wiki.php.net/rfc/sendrecvmsg> The module ext/sockets, a wrapper around the sockets API, does not include support to recvmsg() and sendmsg()

Re: [PHP-DEV] Questions regarding DateTimeImmutable

2013-02-20 Thread Gustavo Lopes
. The solution is simple: separate the classes and provide a toDateTime() on DateTimeImmutable for interoperability purposes. One wouldn't need to go through Atom libraries code to know this is a solution that can't cause problems. -- Gustavo Lopes -- PHP Internals - PHP Runtime Devel

Re: [PHP-DEV] double val to long val conversion issue

2013-02-20 Thread Gustavo Lopes
his is only important in 32-bit systems though; for the others, the doubles outside the long range have no fractional part. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Questions regarding DateTimeImmutable

2013-02-20 Thread Gustavo Lopes
ta about how many but I find it highly likely that many users simply don't care about the difference. Here is some data: http://code.google.com/codesearch#search/&q=%5C$date-%3Emodify%20lang:php&type=cs&sq= As you can see, your assumption is false. In the majority of cases, t

Re: [PHP-DEV] Question on hash api

2013-02-20 Thread Gustavo Lopes
string (via php_hash_hmac_round), which has an int for the length and therefore is not a problem. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] double val to long val conversion issue

2013-02-19 Thread Gustavo Lopes
supposed to improve? The least significant bytes are preserved. Take int(-2056257536) and int(2943463994971652096): In[6]:= BitAnd[2^32 - 1, {-2056257536, 2943463994971652096}] Out[6]= {2238709760, 2238709760} -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Questions regarding DateTimeImmutable

2013-02-19 Thread Gustavo Lopes
o accept both (I don't think it is), a common superclass with weaker guarantees can be extracted. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] double val to long val conversion issue

2013-02-17 Thread Gustavo Lopes
we do it, I'm afraid we may change some scenario, so I'd prefer to make it 5.5 only. If no one objects, I'll merge this into 5.5 and master: https://github.com/cataphract/php-src/compare/dval_to_lval -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To

[PHP-DEV] Re: mcast patch breaks mac build for 5.5

2013-02-17 Thread Gustavo Lopes
ple as Mac OS X lags one decade behind its competitors. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] double val to long val conversion issue

2013-02-11 Thread Gustavo Lopes
On Mon, 11 Feb 2013 09:43:36 +0100, Remi Collet wrote: Le 10/02/2013 20:27, Gustavo Lopes a écrit : Any reservations? For which values ? Outside LONG_MIN .. ULONG_MAX ? It should be valid for the whole domain, but for performance reasons it would be better to limit it to values at

Re: [PHP-DEV] double val to long val conversion issue

2013-02-10 Thread Gustavo Lopes
On Sun, 10 Feb 2013 16:19:46 +0100, Remi Collet wrote: Le 10/02/2013 15:58, Gustavo Lopes a écrit : Can you test this program on ppc64: $ gcc -O3 -lm conv.c && ./a.out 9223372036854775808 -9223372036854775808 -9223372036854775808 $ gcc -O3 -lm conv.c && ./a.out 4e21 -294

Re: [PHP-DEV] double val to long val conversion issue

2013-02-10 Thread Gustavo Lopes
On Sun, 10 Feb 2013 12:00:01 +0100, Gustavo Lopes wrote: My concern is that we may also have different behavior when we go outside the unsigned long range. As to whether ppc64 or x86_64 is correct when casting (double)LONG_MAX to a signed long, the answer is this that since the double

Re: [PHP-DEV] double val to long val conversion issue

2013-02-10 Thread Gustavo Lopes
the double is outside long range, the behavior is undefined. If we want more predictability, we have to do the conversion ourselves and probably take a small performance hit. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: AW: [PHP-DEV] FILTER_VALIDATE_INT and +0/-0

2013-02-08 Thread Gustavo Lopes
On Fri, 08 Feb 2013 22:09:22 +0100, hakre wrote: - Ursprüngliche Message - Von: Gustavo Lopes A special case still left is "±0". It is with the 'PLUS-MINUS SIGN' (U+00B1). By special case, I meant a deviation to the general rule on how the code handles

Re: AW: [PHP-DEV] FILTER_VALIDATE_INT and +0/-0

2013-02-08 Thread Gustavo Lopes
On Fri, 08 Feb 2013 20:04:35 +0100, hakre wrote: - Ursprüngliche Message - Von: Gustavo Lopes So the question is only whether "+0" or "-0" (or "+0", etc.) should be accepted as integers by FILTER_VALIDATE_INT. I think they should, because we also accep

Re: [PHP-DEV] ArrayAccess/ArrayObject return by reference

2013-02-06 Thread Gustavo Lopes
e ArrayObject's offsetGet and return by reference. Those would be compatible with the modification in ArrayObject. We've allowed overrides to return by reference when the parent doesn't for quite a while now. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development

Re: [PHP-DEV] PHP 5.4.11 tests: floating point diff

2013-02-04 Thread Gustavo Lopes
Therefore, I would be inclined to suggest that this is indeed a bug in math library, but this was just a quick check (may depend on which standards and which versions are followed, etc). -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: htt

Re: [PHP-DEV] PHP 5.4.11 tests: floating point diff

2013-02-04 Thread Gustavo Lopes
How would you suggest altering the tests to make this pass? Check these: http://qa.php.net/write-test.php http://qa.php.net/phpt_details.php You can also inspect the file run-tests.php if you have any doubt. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscr

Re: AW: [PHP-DEV] FILTER_VALIDATE_INT and +0/-0

2013-02-04 Thread Gustavo Lopes
except if it's 0" is a good option. It's an unnecessary special case. Finally, please don't top post. See http://lxr.php.net/xref/PHP_TRUNK/README.MAILINGLIST_RULES#67 -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: Non-pointer params, zend_parse_parameters, and the "!" modifier

2013-02-02 Thread Gustavo Lopes
assed in, and we're forced to reset it to the default value (assuming that was our intent). [...] Thoughts? You raise a good point. From my part, feel free to modify it so the passed long is not changed. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Proposal: php://memory/ (& ://temp/)

2013-01-31 Thread Gustavo Lopes
eally need to use operations on the URLs themselves, you can easily write a user wrapper that delegates to static php://memory streams kept statically. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Proposal: php://memory/ (& ://temp/)

2013-01-31 Thread Gustavo Lopes
On Thu, 31 Jan 2013 10:37:53 +0100, Ivan Enderlin @ Hoa wrote: The php://memory, and its respectful sibling php://temp, appear very useful when we need to compute streams on-the-fly. They offer a lot of services, like avoiding HDD accesses, increasing speed... and through a straightforward AP

Re: [PHP-DEV] [RFC] send/recvmsg() wrappers in ext/socket

2013-01-30 Thread Gustavo Lopes
On Tue, 22 Jan 2013 18:23:59 +0100, Gustavo Lopes wrote: https://wiki.php.net/rfc/sendrecvmsg The module ext/sockets, a wrapper around the sockets API, does not include support to recvmsg() and sendmsg(). This RFC addresses this shortcoming by support introducing limited (only a few

Re: [PHP-DEV] [VOTE] Deprecate and remove calls from incompatible context

2013-01-28 Thread Gustavo Lopes
disruptive BC breaks like eliminating call-time pass-by-ref and changing the default encoding for htmlentities/htmlspecialchars and new keywords. 5.5 will also introduce a few (look at UPGRADING). -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit

Re: [PHP-DEV] [VOTE] Deprecate and remove calls from incompatible context

2013-01-28 Thread Gustavo Lopes
hstanding, there was nothing remotely irregular about the way the process was conducted. I therefore find your comments about "sneaking this in" rather odd. Blame yourself instead. Again, I'm not commenting on the merits. -- Gustavo Lopes -- PHP Internals - PHP Runtime D

Re: [PHP-DEV] [VOTE] Deprecate and remove calls from incompatible context

2013-01-28 Thread Gustavo Lopes
te that by the time this feature is removed, no PHP version without traits will be maintained anymore. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Deprecate and remove calls from incompatible context

2013-01-28 Thread Gustavo Lopes
On Sun, 20 Jan 2013 20:17:05 +0100, Gustavo Lopes wrote: I've opened the vote for the "remove calls from incompatible context" RFC: https://wiki.php.net/rfc/incompat_ctx#vote The RFC has been accepted unanimously. I'll implement it shortly. The change is tri

[PHP-DEV] [RFC] send/recvmsg() wrappers in ext/socket

2013-01-22 Thread Gustavo Lopes
. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: com php-src: fix bug #63462 (Magic methods called twice for unset protected properties): NEWS Zend/tests/bug63462.phpt Zend/zend_object_handlers.c

2013-01-22 Thread Gustavo Lopes
On Tue, 22 Jan 2013 09:38:11 +0100, Stas Malyshev wrote: this appears to break tests/classes/unset_properties.phpt on 5.5 branch, can you please look into this? Thanks, fixed. Seems to be failing on 5.4 as well. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] [VOTE] Alternative typehinting syntax for accessors

2013-01-21 Thread Gustavo Lopes
be about to start introducing a fundamental change in the language in an incremental backdoor fashion. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Alternative typehinting syntax for accessors

2013-01-21 Thread Gustavo Lopes
Yes, this is a slippery slope argument. Slippery slopes are a real phenomenon. People interested in this topic can read this reference [1]. [1] https://www.law.ucla.edu/volokh/slippery.pdf -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] [VOTE] Deprecate and remove calls from incompatible context

2013-01-20 Thread Gustavo Lopes
I've opened the vote for the "remove calls from incompatible context" RFC: https://wiki.php.net/rfc/incompat_ctx#vote -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Property Accessors for 5.5

2013-01-20 Thread Gustavo Lopes
get { return $this->value * $this->scale; } set; } function __construct($scale) { $this->scale = (double)$scale; } } -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Property Accessors for 5.5

2013-01-20 Thread Gustavo Lopes
w exceptions or have side effects ("the code behaves differently when add a var_dump()?!"). -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] zend_parse_parameters() improvements

2013-01-16 Thread Gustavo Lopes
On Wed, 09 Jan 2013 17:19:10 +0100, Gustavo Lopes wrote: I've opened voting for the zend_parse_parameters() improvements RFC. You can now go to https://wiki.php.net/rfc/zpp_improv#voting The RFC was unanimously accepted. I've merged it to 5.5 in b8603035. Thank you. -- Gus

Re: [PHP-DEV] strtr vs. str_replace runtime

2013-01-15 Thread Gustavo Lopes
On Mon, 14 Jan 2013 22:55:33 +0100, Gustavo Lopes wrote: OK, so now the plan is to merge this onto 5.4: https://github.com/cataphract/php-src/compare/php:PHP-5.4...cataphract:strtr_wu94_54 And this to 5.5: https://github.com/cataphract/php-src/compare/php:PHP-5.5

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-14 Thread Gustavo Lopes
) usually include a final global vote at the end. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-14 Thread Gustavo Lopes
re taking from people the power to condition the vote on a specific choice of name. Personally, I don't care about the name as long as only one is chosen (no alias). -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] strtr vs. str_replace runtime

2013-01-14 Thread Gustavo Lopes
On Wed, 09 Jan 2013 23:45:03 +0100, Gustavo Lopes wrote: On Thu, 03 Jan 2013 11:40:31 +0100, Gustavo Lopes wrote: The algorithm behaves very poorly in this case because at each position of the text, all the substrings starting there and with size between m and n (where m is the size

Re: [PHP-DEV] strtr vs. str_replace runtime

2013-01-14 Thread Gustavo Lopes
st 7 strtr: 1.2030 str_replace: 0.0850 results match! Replacements: 2 total, smallest 7 largest 2500 ^C (got tired of waiting after a few minutes) -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Add a zend_qsort_r/zend_qsort implementation

2013-01-10 Thread Gustavo Lopes
t2); echo "sorted:" . number_format( microtime( true ) - $start, 4 ) . "\n"; unset($t2); $t3 = $a; rsort($t3); $start = microtime( true ); sort($t3); echo "reverse sorted: " . number_format( microtime( true ) - $start, 4 ) . "\n"; -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] strtr vs. str_replace runtime

2013-01-09 Thread Gustavo Lopes
On Thu, 03 Jan 2013 11:40:31 +0100, Gustavo Lopes wrote: The algorithm behaves very poorly in this case because at each position of the text, all the substrings starting there and with size between m and n (where m is the size of the smallest pattern and n is the largest) are checked

[PHP-DEV] [VOTE] zend_parse_parameters() improvements

2013-01-09 Thread Gustavo Lopes
I've opened voting for the zend_parse_parameters() improvements RFC. You can now go to https://wiki.php.net/rfc/zpp_improv#voting Regards -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] strtr vs. str_replace runtime

2013-01-03 Thread Gustavo Lopes
the text. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] [RFC] zend_parse_parameters() improvements

2013-01-02 Thread Gustavo Lopes
Em 2012-07-18 23:05, Gustavo Lopes escreveu: Some deficiencies in zpp have been constrai ning the implementation of common scenarios such as 'allow integer or NULL'* or the more general 'allow different types for an argument'**. I've written an RFC. It's availa

Re: [PHP-DEV] PHP-5.5 unpack change broke pecl/pear

2012-12-24 Thread Gustavo Lopes
several orders of magnitude less people than the htmlentities() change in 5.4) for one that will exist indefinitely and I consider that a poor choice. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] zend_parse_parameters() improvements

2012-12-20 Thread Gustavo Lopes
Em 2012-12-19 22:07, Nikita Popov escreveu: On Wed, Jul 18, 2012 at 11:05 PM, Gustavo Lopes wrote: Some deficiencies in zpp have been constrai ning the implementation of common scenarios such as allow integer or NULL* or the more general allow different types for an argument**. So I

Re: [PHP-DEV] Incomprehension with preg_match and utf8

2012-11-05 Thread Gustavo Lopes
ot match any of the POSIX character classes.") but I've got 1 in some case : The documentation is simply out-of-date. We have set PCRE_UCP if the 'u' modifier is present for some time now (since 87a237342, 3 Oct 2010). Look for PCRE_UCP in http://www.pcre.org/pcre.txt to k

Re: [PHP-DEV] [RFC] ICU UConverter implementation for ext/intl

2012-10-30 Thread Gustavo Lopes
null). Unusual as this may be, it would be a bad idea to introduce inconsistency here. See the implementations in the other modules. * The tests have poor coverage. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] stream_get_line behaviour Bug #63240

2012-10-11 Thread Gustavo Lopes
tream_get_line($handle, 8192, "MM")) !== false) { if (strlen($buffer) == 8192) { //You may consider this an error } echo $buffer; } } while (!feof($handle)) -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Are exceptions allowed in php core?

2012-09-04 Thread Gustavo Lopes
onality that fails. But as far as I can see you can not make any of existing SPL iterators to throw by repeatedly iterating over them. Even NoRewindIterator - which states "no rewind" in its name - does not throw when you try to repeatedly iterate over it. I disagree that this is a nor

Re: [PHP-DEV] Re: Are exceptions allowed in php core?

2012-09-03 Thread Gustavo Lopes
he context of a foreach, in a hierarchy where exception throwing is well established. So it's not really analogous. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Are exceptions allowed in php core?

2012-09-03 Thread Gustavo Lopes
ages but does is buggy, but the fact that some code raises an E_STRICT does not signal, by itself, a bug. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Are exceptions allowed in php core?

2012-09-03 Thread Gustavo Lopes
ue doing what? I've replied here: http://www.mail-archive.com/internals@lists.php.net/msg60706.html -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Exceptions Vs Errors

2012-09-02 Thread Gustavo Lopes
t's feasible, except maybe by using checked exceptions (which most people hate, with good reason). Writing bad exception-based code and bad error-code-based code is always easy. See the tables here: http://blogs.msdn.com/b/oldnewthing/archive/2005/01/14/352949.aspx -- Gustavo Lopes --

Re: [PHP-DEV] Re: Are exceptions allowed in php core?

2012-09-02 Thread Gustavo Lopes
money -- or in far more destructive manners (for instance, if the iterator was to return a set of files or database entities to keep when deleting others). -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Are exceptions allowed in php core?

2012-09-01 Thread Gustavo Lopes
l error would also be somewhat appropriate (though inconsistent with the other Zend interfaces), but definitely a warning is not. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Are exceptions allowed in php core?

2012-09-01 Thread Gustavo Lopes
On Sun, 02 Sep 2012 02:27:02 +0200, Rasmus Lerdorf wrote: On 09/01/2012 04:51 PM, Gustavo Lopes wrote * In fact, if there is a unifying theme in the usage of exceptions in PHP, is that exceptions are used when OOP interfaces are involved (see Zend interfaces, SPL, DateTime and PDO

Re: [PHP-DEV] Re: Are exceptions allowed in php core?

2012-09-01 Thread Gustavo Lopes
n-core argument only looks attractive because there are few built-in classes in the core. To be sure, there's one important distinction between core and ext/spl. ext/spl should depend on core, not the other way around. Which has little relevance for this discussion. -- Gustavo Lopes

Re: [PHP-DEV] Re: [VOTE] Generators

2012-09-01 Thread Gustavo Lopes
ssue can be adjudicated by the community through an RFC that establishes either a clear general policy for exception throwing or handles just this particular case. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Generators

2012-08-29 Thread Gustavo Lopes
rse an already closed generator. Nothing in the core throws an exception, why would this?! This is not accurate. All the iterators throw exceptions on similar situations. Generators are iterators, so I see no deviation from the norm here. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: [VOTE]Call for voting: support use list in foreach

2012-08-26 Thread Gustavo Lopes
e; a model with an elected committee could make more sense. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Aspect Oriented Programming in PHP

2012-08-24 Thread Gustavo Lopes
ght want to take a look nevertheless; this is the weld (CDI reference implementation) documentation: * http://docs.jboss.org/weld/reference/latest/en-US/html/interceptors.html * http://docs.jboss.org/weld/reference/latest/en-US/html/decorators.html -- Gustavo Lopes -- PHP Internals - PHP Runtime De

Re: [PHP-DEV] shared mysqlnd extension ...

2012-08-21 Thread Gustavo Lopes
Em 2012-08-21 14:10, Lester Caine escreveu: Gustavo Lopes wrote: So should I be updating that bug to the current state of play? That this is actually by design? Or create a new bug that states that '--enable-mysqlnd=shared' should not be allowed? Or is there some third position in t

Re: [PHP-DEV] shared mysqlnd extension ...

2012-08-21 Thread Gustavo Lopes
e sure as I haven't tested it. But there's nothing in the problem you're having that points to it not working when built properly. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] register_globals work arounds

2012-08-02 Thread Gustavo Lopes
doing that yourself, this is clearly off-topic. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Remove calls with incompatible Context

2012-08-02 Thread Gustavo Lopes
Em 2012-07-31 1:55, Christopher Jones escreveu: On 07/30/2012 01:32 PM, Gustavo Lopes wrote: 3. There are other low-cost alternatives, namely the obvious one: pass the object via an extra parameter instead of operating on $this directly and unconditionally. This is really easy to do. This

Re: [PHP-DEV] [RFC] Remove calls with incompatible Context

2012-07-30 Thread Gustavo Lopes
Em Mon, 30 Jul 2012 21:11:58 +0200, Todd Ruth escreveu: On Mon, 2012-07-30 at 19:31 +0200, Gustavo Lopes wrote: https://wiki.php.net/rfc/incompat_ctx An RFC for deprecating and removing $this from incompatible context. Comments are welcome. I'm just a user, but I'd like to be

Re: [PHP-DEV] [RFC] Remove calls with incompatible Context

2012-07-30 Thread Gustavo Lopes
ittle more definitive. As much as I'd like to have an error at call site here, the most sensible option is to just have $this === null inside the callee, like when you do: class A { function foo() {} } A::foo(); // E_STRICT I'll update the RFC with this. -- Gustavo Lopes -- PHP Int

[PHP-DEV] [RFC] Remove calls with incompatible Context

2012-07-30 Thread Gustavo Lopes
https://wiki.php.net/rfc/incompat_ctx An RFC for deprecating and removing $this from incompatible context. Comments are welcome. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Run-tests.php JUnit format issue

2012-07-28 Thread Gustavo Lopes
byte sequence in UTF-8. Of course, the underlying problem is that many tests are not encoded in UTF-8. I think Anthony's solution is fine. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Generators in PHP

2012-07-24 Thread Gustavo Lopes
entation of that object is inside the body of the function. Maybe this helps you reason about the feature. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] zend_parse_parameters() improvements

2012-07-21 Thread Gustavo Lopes
(2*$1, $b === null ? null : 2 * $b); } you would need: function userland_wrapper($a, $b=null) { $args = func_get_args(); $args[0] *= 2; if (isset($args[1])) { $args[1] *= 2; } else { unset($args[1]); } call_user_func_array('internal_func', $args); } -

Re: [PHP-DEV] zend_parse_parameters() improvements

2012-07-19 Thread Gustavo Lopes
added, it doesn't seem so bad now. And just to clear, I agree with Sara that ! (both for l/d/b and the pointer types) should not be redefined to "parameter was passed". But it's my understanding that that's not what you're planning. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] zend_parse_parameters() improvements

2012-07-19 Thread Gustavo Lopes
!s!, &str, &str_len, &start, &length, &length_is_null, &encoding) Then we have length_is_null == 0 <=> $length was not passed or NULL was its value (just like the userland check above). -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] zend_parse_parameters() improvements

2012-07-19 Thread Gustavo Lopes
y point where this alternative would be superior would be in that it would require one less local variable. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] zend_parse_parameters() improvements

2012-07-18 Thread Gustavo Lopes
ctions to implement complex cases in more consistent manner - right now I know there are some functions that return different error messages than zpp does when they parse arguments, for example - this can be fixes. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] zend_parse_parameters() improvements

2012-07-18 Thread Gustavo Lopes
;l) == SUCCESS) { TimeZone::createEnumeration((int32_t) l); } else if (zend_parse_parameter(ZEND_PARSE_PARAMS_QUIET, 1 TSRMLS_DC, arg, "s", &s, &s_len) == SUCCESS) { TimeZone::createEnumeration(s); } else { //raise errror } } -- Gusta

Re: [PHP-DEV] Implicit isset in ternary operator

2012-07-18 Thread Gustavo Lopes
-re-php-dev-implicit-isset-isempty-check-on-short-ternary-operator -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.)

2012-07-17 Thread Gustavo Lopes
On Tue, 17 Jul 2012 12:07:09 +0200, Pierre Joye wrote: On Tue, Jul 17, 2012 at 2:12 AM, Gustavo Lopes wrote: Adding method call syntax to arrays hardly makes PHP more object oriented. Syntax is unimportant. There's no substantial difference between array_slice($arr, ...) and $arr-&

Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.)

2012-07-16 Thread Gustavo Lopes
is will require a lot of work, thought, and time tough. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] New String Function: str_replace_limit

2012-07-16 Thread Gustavo Lopes
On Sun, 15 Jul 2012 20:59:10 +0100, Paul Dragoonis wrote: The 4th param to str_replace is a by-ref param, so you can't just skip over it, can you ? I don't think so, but we could make it so that you could by using optional passing by reference. -- Gustavo Lopes -- PHP Inter

Re: [PHP-DEV] Re: array_last_key() function

2012-07-14 Thread Gustavo Lopes
ay copying parts you the array, it is not a problem to change those copies. -- Gustavo Lopes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

  1   2   3   4   >