Re: [PHP-DEV] Throwing an E_DEPRECATED for short_open_tag

2010-01-15 Thread Ángel González
Raphael Geissert wrote: Rasmus Lerdorf wrote: But why do you want them to change? Short tags are convenient and if the app doesn't have to worry about ?xml or ?xsl type stuff, it can run happily with short tags enabled. Because it is just not about the application but the whole

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-07-13 Thread Ángel González
On 13/07/12 12:28, Ryan McCue wrote: Somewhat off-topic, but is there a reason why not? It seems to me that introducing a new API without using PHP's best method of error handling (IMHO) is a little silly. I don't really trust exception throwing near password-managing functions. Consider the

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-07-15 Thread Ángel González
On 15/07/12 22:07, Alex Aulbach wrote: 2012/7/14 Andrew Faulds ajf...@googlemail.com: Well... if people have poorly configured servers spitting out debug info in production mode, I don't think it is our problem. It is theirs. Do you want to make it secure or do you want to discuss? Seems

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-07-16 Thread Ángel González
On 16/07/12 08:04, Galen Wright-Watson wrote: What about an approach like PDO, where the password functions would generate errors by default, but could be configured to throw exceptions? The ugliest aspects of this idea are the requirement for another function (password_set_option?) and hidden

Re: [PHP-DEV] Random string generation (á la password_make_salt)

2012-07-16 Thread Ángel González
On 16/07/12 16:21, Anthony Ferrara wrote: If this is something that's desired, I can update the password implementation to include this change (since it depends on a function like this internally)... Anthony Looks good. -- PHP Internals - PHP Runtime Development Mailing List To

Re: [PHP-DEV] Random string generation (á la password_make_salt)

2012-07-16 Thread Ángel González
On 16/07/12 17:32, Alex Aulbach wrote: I like it. I've looked in some code and found about 8 password-generation-functions. 4 of them have more or less the same idea behind. The rest generates more complicated password. E.g. minimum one digit, First letter must be alphabetic. This is easy to

Re: [PHP-DEV] Random string generation (á la password_make_salt)

2012-07-17 Thread Ángel González
On 17/07/12 13:34, Alex Aulbach wrote: That's more or less what I have thought. If it's a string surrounded by square brackets, it's a character class, else treat as a literal list of characters. ] and - can be provided with the old trick of provide ] as first character, make - the first or

Re: [PHP-DEV] common issue with version_compare()

2012-07-21 Thread Ángel González
On 21/07/12 11:32, Pierre Joye wrote: hi, No, I mean version with 1.0 and not 1.0.0 are not. They are just not correct and confusing, as you noticed. Then Linux 2.6.39 shouldn't have been followed by Linux 3.0 For me, 1.0 and 1.0.0 are the same thing. It's fine if x.y is not a valid

Re: [PHP-DEV] common issue with version_compare()

2012-07-23 Thread Ángel González
On 22/07/12 04:08, Kris Craig wrote: On Sat, Jul 21, 2012 at 3:09 AM, Andrew Faulds ajf...@googlemail.comwrote: If you think 1.1 =/= 1.01 you're sure using some weird version numbers. Only 1.0.1 would be smaller. Has anyone seen these weird version ordering schemes in practise? On any major

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-07-31 Thread Ángel González
On 31/07/12 18:21, Anthony Ferrara wrote: Jonathan, On Tue, Jul 31, 2012 at 12:01 PM, Jonathan Bond-Caron jbo...@openmv.comwrote: Sure managing keys properly can be hard, simple cases: $secret = MY_KEY; $secret = file_get_contents('/security/key.pem'); Actually, that's not properly

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-08-01 Thread Ángel González
On 31/07/12 22:20, Peter Lind wrote: On 31 July 2012 22:02, Anthony Ferrara ircmax...@gmail.com wrote: Peter, On Tue, Jul 31, 2012 at 3:46 PM, Peter Lind peter.e.l...@gmail.com wrote: On 31 July 2012 18:21, Anthony Ferrara ircmax...@gmail.com wrote: *snip* Also, be aware that BCrypt only

Re: [PHP-DEV] PHP 5.x Documentend End Of Life Dates

2012-08-01 Thread Ángel González
On 01/08/12 20:02, Kris Craig wrote: On Wed, Aug 1, 2012 at 6:13 AM, hakre hanskren...@yahoo.de wrote: I have some simple questions about PHP 5.x End Of Life (EOL) dates: PHP 5.0 - Is there some official news-item or changelog entry on php.netthat says at which date PHP 5.0 went End Of

Re: [PHP-DEV] Add runkit to PHP Runtime

2012-08-02 Thread Ángel González
On 03/08/12 01:22, Sara Golemon wrote: In all seriousness, I'd love to hear how you'd do Sandboxing without using the tsrm context hack I used in runkit. That approach had nothing to do with being in PECL, it had to do with that being the only mechanism available to swap globals in and out at

Re: [PHP-DEV] Combined assignment operator for short ternary

2012-08-17 Thread Ángel González
On 17/08/12 23:41, Sebastian Krebs wrote: Hi, Don't know, how complicated this is (and also someone (not me) must implement it, because I can't :X), but to be in sync with the operators the short ternary operator should be usable in conjunction with the assignment like the other binary

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Ángel González
On 20/08/12 02:01, Rasmus Lerdorf wrote: I would still like to understand what this generator keyword would actually do. I don't see how it would work. Would a function marked generator somehow not be allowed to return normally or to finish and not return anything? How could this be enforced?

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Ángel González
On 20/08/12 15:12, Nikita Popov wrote: You could not decorate it and rely instead on the presence of the yield keyword, but parsers will thank knowing about it from the start rather than realising at mid-parsing that the function is a completely different beast. No, parsers don't care about

Re: [PHP-DEV] Default input encoding for htmlspecialchars/htmlentities

2012-08-24 Thread Ángel González
El 23/08/12 18:06, Rasmus Lerdorf escribió: htmlspecialchars(), htmlentities(), html_entity_decode() and get_html_translation_table() all take an encoding parameter that used to default to iso-8859-1. We changed the default in PHP 5.4 to UTF-8. This is a much more sensible default and in the

Re: [PHP-DEV] Default input encoding for htmlspecialchars/htmlentities

2012-08-25 Thread Ángel González
On 25/08/12 00:50, Rasmus Lerdorf wrote: In 8859-1 no chars are invalid so anything that doesn't get encoded will get passed through as-is. For example the byte 0xE0 is a perfectly valid 8859-1 character (à), but if the page is actually UTF-8 then this becomes the first byte of a 3-byte UTF-8

Re: [PHP-DEV] RFC: Implementing a core anti-XSS escaping class

2012-09-18 Thread Ángel González
El 18/09/12 13:30, Pádraic Brady escribió: Hi all, I've written an RFC for PHP over at: https://wiki.php.net/rfc/escaper. The RFC is a proposal to implement a standardised means of escaping data which is being output into XML/HTML. Cross-Site Scripting remains one of the most common

Re: [PHP-DEV] RFC: Implementing a core anti-XSS escaping class

2012-09-18 Thread Ángel González
On 18/09/12 21:06, Pádraic Brady wrote: Hi Ángel, The methods all refer to literal strings, values or digits. We can't reasonably escape data while allowing valid markup for the current context since that's a contradiction by its very nature. If you needed to let user values drive CSS names,

Re: [PHP-DEV] Alternatives to mailing list?

2012-10-17 Thread Ángel González
On 17/10/12 11:43, Pierre Joye wrote: It is about hi jacking discussions with totally irrelevant topics, repetitive, nonconstructive posts in rows, in all possible ways. The issue is that the proposed solution (a forum) does not solve irrelevant topics being mixed into a discussion about a

Re: [PHP-DEV] RFC: ext/mysql deprecation

2012-11-13 Thread Ángel González
I see several problems with deprecating ext/mysql: - The extension is not broken. The problem is the bad usage. It can be used safely, and good developers have been doing so for ages, by creating php wrappers. In magic quotes, the work has been the opposite. The developers had been detecting the

Re: [PHP-DEV] RFC: ext/mysql deprecation

2012-11-14 Thread Ángel González
Am 14/11/12 03:26, schrieb Michael Kliewe: Am 14.11.2012 00:23, schrieb Ángel González: So the problem really moves onto the CMS providers, do they support new php versions and drop customers in shared hosting, do they delay supporting the new php versions, or do they reimplement mysql_

Re: [PHP-DEV] RFC: ext/mysql deprecation

2012-11-17 Thread Ángel González
On 16/11/12 17:03, Rasmus Lerdorf wrote: So, I am curious, why are you waiting on us for this? Is it because ext/mysql does everything you need and you simply have no need for any of the new and obviously better features in mysqli? I would have thought you would have switched to mysqli years

Re: [PHP-DEV] RFC: ext/mysql deprecation

2012-11-17 Thread Ángel González
On 17/11/12 17:24, Rasmus Lerdorf wrote: Right, that is what I meant by focusing more on the carrot than the stick. Many people, yourself included, don't realize the things they would gain switching to mysqli. We need to do a better job with that and perhaps even consider if there are other

Re: [PHP-DEV] ext/mysql in PECL and E_DEPRECATED (was: [VOTE] ext/mysql deprecation in 5.5)

2012-11-28 Thread Ángel González
I see it as simple to show E_DEPRECATED but not when installed from PECL. 1) Add a int mysql_extension_triggers_deprecated_warning = 1; And use it as a conditional for triggering the warning. 2) Copy the extension code to PECL 3) Add these changes in PECL - If the mysql functions are not

Re: [PHP-DEV] [RFC] Modify tempnam() to handle directories and auto-cleanup

2012-11-28 Thread Ángel González
On 26/11/12 22:21, Sara Golemon wrote: https://wiki.php.net/rfc/request-tempnam Just a bit of hand-holding for those who don't remember to clean up their messes. I like it. Also note that it's not always that people “don't remember to clean up their messes” since there are several tricky

Re: [PHP-DEV] ext/mysql in PECL and E_DEPRECATED

2012-11-29 Thread Ángel González
David Muir wrote: On 29/11/12 05:09, Ángel González wrote: I see it as simple to show E_DEPRECATED but not when installed from PECL. 1) Add a int mysql_extension_triggers_deprecated_warning = 1; And use it as a conditional for triggering the warning. 2) Copy the extension code to PECL

Re: [PHP-DEV] ext/mysql in PECL and E_DEPRECATED

2012-11-29 Thread Ángel González
On 29/11/12 18:17, Anthony Ferrara wrote: Just pointing this out: that's NOT what this RFC recommends, and is NOT what's being voted on. This RFC is talking about ONLY adding E_DEPRECATED to core. And the way it's proposed to be done, the moves-to-PECL couldn't happen, since it's hard-coded

Re: [PHP-DEV] Passing process handles to proc_open and co

2012-12-06 Thread Ángel González
On 06/12/12 09:49, Pierre Joye wrote: hi! While looking at the bug #63073, I was wondering if we could simply do not pass open handles to the newly created child process. Looking at proc_open, where there is an explicit CreateProcess (we seem to be using the library popen for the exec()...)

Re: [PHP-DEV] Passing process handles to proc_open and co

2012-12-06 Thread Ángel González
On 06/12/12 13:52, Pierre Joye wrote: hi, On Thu, Dec 6, 2012 at 12:40 PM, Ángel González keis...@gmail.com wrote: On 06/12/12 09:49, Pierre Joye wrote: hi! While looking at the bug #63073, I was wondering if we could simply do not pass open handles to the newly created child process

Re: [PHP-DEV] DateTime improvement

2012-12-10 Thread Ángel González
On 10/12/12 16:18, Nikita Nefedov wrote: So there had been at least two or three messages (subjects) about DateTime object and everytime there was this problem - people tend to take DateTime object as mutable object and it really is. As long as we know, it's not so good - date is immutable by

Re: [PHP-DEV] Improve DateTime Class

2012-12-10 Thread Ángel González
On 10/12/12 13:35, Christian Stoller wrote: Hm... I know '$date-add(new DateInterval('P15D'));' is possible, but it has the same problem. I have to write: $date = new DateTime() $date-add(new DateInterval('P' . getDaysToAddMethod() . 'D')); I think it is very hard to read. Or is it just

Re: [PHP-DEV] php 5.3.14 nts source code for windows

2012-12-12 Thread Ángel González
On 12/12/12 17:29, Amir wrote: Hi I searched in php.net and did not find any link that contain php none thread safe source code for windows. I have a php source that encoded with Zend Guard 5.5 and have to decode with Zend Guard Loader. note: Zend Guard Loader is NTS and didn't read TS code.

Re: [PHP-DEV] How about implementing more data structures (ie Map, Set)

2012-12-18 Thread Ángel González
On 18/12/12 15:43, Victor Berchet wrote: Dear all: I would like to get your feedback on implementing some more data structure in the PHP core. (...) I think this could be summarised as allow objects as keys for arrays. Which would give the Map behavior. Implementing Set from that is

Re: [PHP-DEV] FW: Functionality request/proposal

2013-01-14 Thread Ángel González
On 14/01/13 05:10, Paulo Henrique Torrens wrote: Hi, I'm currently interested in two features I'd like to see in PHP; how do I proceed to request/propose them? I'd be glad to help implementing them as well, if necessary. You should propose it here and then create a rfc about it in the php

Re: [PHP-DEV] ZTS - why are you using it?

2013-01-29 Thread Ángel González
On 29/01/13 15:21, Pierre Joye wrote: On Tue, Jan 29, 2013 at 3:16 PM, Zeev Suraski z...@zend.com wrote: On Windows with impersonation you're actually in a better situation than you are in Linux. You could hold a small pool of processes and handle as many different users as you'd like. Works

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-03 Thread Ángel González
On 03/02/13 16:27, Hans-Juergen Petrich wrote: The only different in the second example is the fixed body length of the eval()-created anoymous function. I wondering why the memory in the second code-example will be freed at some point while in the first example not. I don't think it's a

Re: [PHP-DEV] (non)growing memory while creating anoymous functions via eval()

2013-02-04 Thread Ángel González
Hans-Jürgen Petrich wrote: Hi Terry and all thank you very much for your response. The only thing that confused me about what you say that the second *doesn't* grow Yes, about that i was [and am still :-)] also confused... why the 2nd one won't grow *non-stop* so I checked and it does --

Re: [PHP-DEV] Proposal for serious BC compatibility aka language versioning

2013-02-06 Thread Ángel González
On 05/02/13 21:16, Karoly Negyesi wrote: new keywords is an interesting discussion to have -- it's actually the first real thing to discuss as far as I can see. For example that is something that version strings would tremendously help. You do not need to maintain the whole lot of behaviors

Re: [PHP-DEV] Re: O+ 1st results

2013-02-15 Thread Ángel González
On 15/02/13 10:25, Paul Dragoonis wrote: On Fri, Feb 15, 2013 at 9:23 AM, Damien Tournoud d...@damz.org wrote: On Fri, Feb 15, 2013 at 9:54 AM, Pierre Joye pierre@gmail.com wrote: no, MediaWiki caching modules only support APC or Wincache so far. As far as I understand, O+ doesn't have

Re: [PHP-DEV] Double-Colon Always Follows the 'parent' Keyword?

2013-03-11 Thread Ángel González
On 11/03/13 12:19, Eric James Michael Ritz wrote: Hello everyone, I have a question about the internals of PHP, but this is not about advancing the development of the language, so I apologize if this is on the wrong list. I am choosing to post to this list because I believe the people here

Re: [PHP-DEV] data stream restricted by allow_url_fopen (Bug #47336)

2013-03-11 Thread Ángel González
On 11/03/13 12:36, Christian Stoller wrote: Hi Stas. I'm afraid it is not a good idea. allow_url_fopen is meant to protect file functions (fopen and friends) from being injected with user-controlled data - i.e. if you control the filesystem and you do fopen() under allow_url_fopen then it is

Re: [PHP-DEV] DateTime-modify('tomorrow') Bug in PHP 5.3 on Linux

2013-03-12 Thread Ángel González
On 12/03/13 17:30, Derick Rethans wrote: On Tue, 12 Mar 2013, Jonathan Sundquist wrote: Why would the result not preserve the time? Because tomorrow starts at midnight. You want +1 day. cheers, Derick Alternatively, $d-add(new DateInterval('P1D')); -- PHP Internals - PHP Runtime

Re: [PHP-DEV] Could we kill call_user_func?

2013-03-15 Thread Ángel González
On 15/03/13 15:19, Steve Clay wrote: I'm sure this question has been discussed before, so if anyone can point to me to links or briefly recap I'd appreciate it. Why can't we make $someCallable() always work? E.g. http://3v4l.org/FLpAq I understand the problem of $obj-foo() where -foo is a

Re: [PHP-DEV] Could we kill call_user_func?

2013-03-18 Thread Ángel González
On 18/03/13 14:04, Julien Pauli wrote: Also, AFAIR, call_user_func() doesn't work with functions using references in args. Julien.Pauli AFAIK it does. Do you have an example where it doesn't? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] Re: [lists.php] Re: [PHP-DEV] [RFC] more secure unserialize()

2013-03-31 Thread Ángel González
On 31/03/13 23:18, ALeX wrote: JSON and serialize() are (inherently) different serialization formats with different use-cases [...] Yes, and json requires that all strings (including the keys) has to be valid utf-8, and I'm sure that's not always the case (serialize can use binary data in

Re: [PHP-DEV] crypt() should raise error without 2nd parameter

2013-08-07 Thread Ángel González
On 07/08/13 13:00, Leigh wrote: On 7 August 2013 11:18, Yasuo Ohgakiyohg...@ohgaki.net wrote: A user requested that crypt() should raise error without 2nd(slat) parameter. https://bugs.php.net/bug.php?id=55036 crypt() without salt generates extremely weak password hash. The docs seem to

Re: [PHP-DEV] zend bison check

2013-08-08 Thread Ángel González
On 08/08/13 20:56, Michael Wallner wrote: As I have no Zend karma, is anybody kind enough to merge the bison blacklist patch? https://github.com/php/php-src/pull/402 Maybe it should be bison_version_exclude=none so that the error message is nicer? -- PHP Internals - PHP Runtime Development

Re: [PHP-DEV] [RFC]strn(case)cmp supporting negative length as third parameter

2011-07-28 Thread Ángel González
Laruence wrote: Hi: strn(case)cmp dosen't support a negative length as its third paramter, while substr dose. here is the rfc: https://wiki.php.net/rfc/strncmpnegativelen any question? plz worte me back. thanks What do you exactly mean by in the reverse order in if the abs of

Re: [PHP-DEV] ZE2 broken by newer gcc

2011-09-11 Thread Ángel González
Flavius Aspra wrote: Hi I think I've found a bug in the engine, and I think it occures only with the latest gcc (gcc version 4.6.1 20110819 (prerelease)), since it used to work with earlier versions. For example line 867 http://lxr.php.net/opengrok/xref/PHP_5_3/Zend/zend_execute_API.c#867

Re: [PHP-DEV] A couple of missing directories if configure.js is forgotten.

2011-09-15 Thread Ángel González
Richard Quadling wrote: Hi. Sometimes I remove Release prior to nmake to make sure everything builds clean. 2 directories fail to get build Release\win32 Release\devel The attached patch fixes that. - @for %D in ($(BUILD_DIRS_SUB)) do @if not exist %D @mkdir %D NUL + @for %D in

Re: [PHP-DEV] open_basedir bypass

2011-09-27 Thread Ángel González
Reindl Harald wrote: below a correct open_basedir restriction but why can fopen() create this file outside the basedir and after that the restriction is active? this means in other words: fopen() can empty files outside the basedir if their permissions are open enough Sep 27 10:53:26

Re: [PHP-DEV] open_basedir bypass - errata tempnam()

2011-09-27 Thread Ángel González
Reindl Harald schrieb: [root@arrakis:~]$ stat /tmp/rhcsvz8QeBL File: „/tmp/rhcsvz8QeBL“ Are you sure it is the fopen() what is making it? I think that some other function/extension may be creating the temporary file /tmp/rhcsvz8QeBL for you to open, which then fails due to the open_basedir.

Re: [PHP-DEV] Reply-to of mailing lists (was: open_basedir bypass - errata tempnam() )

2011-09-28 Thread Ángel González
Ferenc Kovacs wrote: well if there would be used Reply-To-Headers tell me ONE reason to get every answer twice I don't get two emails in gmail, I don't know that the list is smart enough to not send emails those who are to or cc'ed, or maybe it's a gmail feature. That's a gmail (mis)feature.

Re: [PHP-DEV] Reply-to of mailing lists

2011-09-28 Thread Ángel González
Ferenc Kovacs wrote: A benefit of being addressed in the email that hasn't been mentioned yet, johannes mentioned it: http://www.mail-archive.com/internals@lists.php.net/msg53737.html Yes, I noticed it /after/ sending. :( Our emails were alike. We mentioned the same usage pattern and both

Re: [PHP-DEV] Cast trap with INI entries compiling C++ extension

2011-09-29 Thread Ángel González
On 29/09/11 14:14, Olivier Favre wrote: Hi everyone, I've been developing a PHP extension for internal needs. We're using C++, by using PHP_REQUIRE_CXX() in config.m4. I'm using debian sid 64bits, with the package php5-dev-5.3.8-2 (against which the patch below has been created). (...) My

Re: [PHP-DEV] Cast trap with INI entries compiling C++ extension

2011-09-29 Thread Ángel González
On 29/09/11 17:42, Olivier Favre wrote: I checked with a tiny test program, you're right about GCC complaining. The right fix is to make the field const (I don't know about const keyword). G++ won't give warnings, no error would be triggered by a broken fix. By the way, const char* and char

Re: [PHP-DEV] Cast trap with INI entries compiling C++ extension

2011-09-29 Thread Ángel González
Gustavo Lopes wrote: const char * and char const * are the same (just like const int and int const are the same); what's not the same is char *const. Andrey Hristov wrote: it's easy, whatever const is closer to is immutable const char * is a pointer to a const char, because the const is

Re: [PHP-DEV] [bug] #55814 stream_socket_recvfrom() “randomly” returns false

2011-10-13 Thread Ángel González
Ivan Enderlin wrote: Hi all, Some days ago, I have filled a bug about an issue with stream_socket_recvfrom() only (apparently) on Windows7. You will see all the details here: . This bug is important for my Windows users and I hope seeing this bug fixed in PHP5.4. I am willing to write a

Re: [PHP-DEV] Changed behaviour of gzencode in PHP-5.4

2011-10-28 Thread Ángel González
Am 28.10.11 17:29, Reindl Harald schrieb: Am 28.10.2011 10:59, schrieb Michael Wallner: gzencode in PHP-5.4 behaves differently than in previous versions. I outlined the reasoning in the comment from 2009-03-03 22:11 UTC at http://bugs.php.net/47178 as long gzdecode() can decode stored data

Re: [PHP-DEV] Failing Tests

2011-12-10 Thread Ángel González
On 10/12/11 16:30, Clint M Priest wrote: I've got 122 tests that are failing on a full run, if I write the failed tests to a file and re-run just those tests, all of them pass. Any ideas whats up? A previous test breaking them? -- PHP Internals - PHP Runtime Development Mailing List To

Re: [PHP-DEV] Local time zone

2011-12-14 Thread Ángel González
On 14/12/11 22:53, Will Fitch wrote: I believe he's referring to sys/time.h, but this introduces portability issues. If it were just unix, that would be one thing. But maintaining this and a Windows alternative, and I have no idea what that is, is not worth it IMO. time.h is present in

Re: [PHP-DEV] Local time zone

2011-12-14 Thread Ángel González
On 15/12/11 00:10, Oleg Oshmyan wrote: PHP internally already has php_localtime_r and php_gmtime_r in main/php_reentrancy.h, implemented in main/reentrancy.c, and they are already used in various places in the code, including the guessing algorithm that is being removed in PHP 5.4. So at the

Re: [PHP-DEV] Constant arrays

2011-12-19 Thread Ángel González
On 19/12/11 21:23, Paul Dragoonis wrote: Barbu, This is how constants work in all viable languages such as C/++. I disagree. In C you can have: const data foo[] = { { Data1, 2 }, { Data2, 78 } }; It's not unusual in php to have a complex structure that won't change in a variable. It should be

Re: [PHP-DEV] Return Type Hinting for Methods RFC

2011-12-22 Thread Ángel González
Your examples only show class methods with visibility qualifyiers, and looking at the changes to zend_language_parser.y it seems as if would only be available for methods. Wouldn't return hints be available for plain functions? In functional programming, it is common to return nullable types:

Re: [PHP-DEV] Return Type Hinting for Methods RFC

2011-12-22 Thread Ángel González
On 23/12/11 00:08, Will Fitch wrote: Sent from my iPad On Dec 22, 2011, at 5:51 PM, Ángel González keis...@gmail.com wrote: Your examples only show class methods with visibility qualifyiers, and looking at the changes to zend_language_parser.y it seems as if would only be available

Re: [PHP-DEV] Return Type Hinting for Methods RFC

2011-12-22 Thread Ángel González
On 23/12/11 01:00, Will Fitch wrote: On Dec 22, 2011, at 6:28 PM, Stas Malyshev smalys...@sugarcrm.com wrote: In PHP, returning object if everything is OK and false if not is a very common pattern. Also, you understand that always allowing null means that this construct: $foo =

Re: [PHP-DEV] Return Type Hinting for Methods RFC

2011-12-22 Thread Ángel González
(I'm unsure about the T_DOUBLE_ARROW, although for parsing, I feel there should be some token there before the class name, though I'm unconvinced on which) What about this? function foo (Class1 $a, Class2 $b) return Class3 { /* Do something */ return new Class3($a, $b); } -- PHP

Re: [PHP-DEV] [Proposal] Remove the tail ws in codes

2011-12-24 Thread Ángel González
On 24/12/11 15:55, Lester Caine wrote: I'm with Derek ... having commits that are just WS corrections can be irritating when tracking changes ... but it would most definitely better to get them fixed before moving to git which would lump mass commits like that together in a change set and make

Re: [PHP-DEV] Bug 60596 - With Patch

2011-12-24 Thread Ángel González
On 24/12/11 18:22, Anthony Ferrara wrote: It's really simple, and would likely be optimized away by the compiler anyway, but I figured it was worth cleaning up... Yep, it's straightforward. I'm not sure if it makes a difference or not. IS_DOUBLE is between IS_LONG and IS_BOOL so the compiler

Re: [PHP-DEV] Feature Request

2012-01-04 Thread Ángel González
On 04/01/12 17:18, Keloran wrote: which can if your doing lots of checking alot of extra code for no reason, or if you want to use variables, lots of louse variables just for something that could be pulled from the request I don't think it would mean 'a lot of code', but if it bothers you in

Re: [PHP-DEV] 64bit Windows builds

2012-01-18 Thread Ángel González
On 18/01/12 20:35, Pierre Joye wrote: Actually, no. There are any number of free mechanisms to build 64 bit code. None of them are part of what we support tho' (we do not support mingw for example, and won't support it). Actually, why couldn't mingw be supported one day? (supposing someone

Re: [PHP-DEV] Shebang parsing

2012-01-25 Thread Ángel González
On 26/01/12 00:22, Robert Eisele wrote: My specific problem could be tackled in two ways: - Scan . every time cli is called for a php.ini file or - Try to make argv interpretation more intelligent and parse/merge shebang parameters. There are |.user.ini files, but only for CGI/FastCGI

Re: [PHP-DEV] Shebang parsing

2012-01-26 Thread Ángel González
On 26/01/12 11:35, Kiall Mac Innes wrote: Surely you can detect which operating system you're running on, and have PHP act accordingly? (Note: on my phone, haven't read the link!) Kiall It's probably not reliable. Note that a simple and completely reliable solution would be instead of having

Re: [PHP-DEV] A potential patch for Bug#60668

2012-01-26 Thread Ángel González
About Kiyoto's patch: Some servers would read as new headers if the newlines were just \n or \r (which would be illegal per HTTP spec). I think the characters to ban are: \n \r \0 Just replace your call to zend_trim_after_carriage_return with: + strtok(new_value, \r\n); // Truncate on \n, \r

Re: [PHP-DEV] Uploading a patch fails...

2012-01-28 Thread Ángel González
On 28/01/12 03:05, Rasmus Lerdorf wrote: There is a 100k limit, but the error message you are getting indicates that you aren't actually hitting that limitation. The server config has a 2M limit, so you should be fitting well within that. I'm not sure how your 200k patch is hittig that file is

Re: [PHP-DEV] Suhosin patch disabled by default in Debian php5 builds

2012-02-02 Thread Ángel González
Stefan Esser wrote: And there are many many good reasons, why Suhosin must be external to PHP. The most obvious one is that the code is clearly separated, so that not someone of the hundred PHP commiters accidently breaks a safe guard. That's not a justification to keep it as a patch. Safe

Re: [PHP-DEV] The case of HTTP response splitting protection in PHP

2012-02-03 Thread Ángel González
On 03/02/12 15:01, Gustavo Lopes wrote: I've committed a different version that also forbids \0 (since, as Stefan says, a NUL byte can result in the truncation of the rest of the header) and that accepts a CRLF:

Re: [PHP-DEV] The case of HTTP response splitting protection in PHP

2012-02-03 Thread Ángel González
On 03/02/12 23:00, Stas Malyshev wrote: Hi! As it's a security patch and of small scope, I would consider it for 5.4. Stas, David? Do we have unit tests for this code? The fix involves changes in header sending so it may have impact on lots of code. Changes like this can be dangerous.

Re: [PHP-DEV] The case of HTTP response splitting protection in PHP

2012-02-03 Thread Ángel González
On 03/02/12 21:44, Ángel González wrote: On 03/02/12 15:01, Gustavo Lopes wrote: I've committed a different version that also forbids \0 (since, as Stefan says, a NUL byte can result in the truncation of the rest of the header) and that accepts a CRLF: http://svn.php.net/viewvc/php/php-src

Re: [PHP-DEV] The case of HTTP response splitting protection in PHP

2012-02-04 Thread Ángel González
Gustavo Lopes wrote: On Sat, 04 Feb 2012 00:06:45 +0100, Ángel González wrote: I've gone ahead and written code for that feature. Comments welcome. The comparison has a problem: if char is signed (the most common scenario), you'll be making a signed comparison, so any character over 0x7f

Re: [PHP-DEV] When is PHP6 Beta going to be available ;)

2012-02-07 Thread Ángel González
On 02/07/12 14:18, Reindl Harald wrote: Am 07.02.2012 13:39, schrieb Matti Bickel: According to http://hilfe-center.1und1.de/hosting/scripte_datenbanken/php/6.html the advertised PHP6 is probably PHP5.4RC6... what has this do do with PHP6? That page seem to list all php configurations they

Re: [PHP-DEV] how to debug a php script ( the C code beneath it)

2012-02-13 Thread Ángel González
On 13/02/12 21:48, Adi Mutu wrote: Hello, Perhaps this is a stupid question, but i haven't coded in C in years and i'm not very familiar with development/debugging tools. If I have a php script say 20 lines, How can I see a path of the corresponding C code which is executed? What If i

Re: [PHP-DEV] Internal server error on PHP syntax error?

2012-02-13 Thread Ángel González
On 13/02/12 22:11, Jakov Sosic wrote: On 02/13/2012 06:10 PM, Reindl Harald wrote: yes, but the more important is the status code so that search engines do not index you broken page, apache SHOULD NOT provide his own error-page because you can also send 500 status code within your script

Re: [PHP-DEV] file_get_contents from HTTPS on Slackware 13.1

2012-02-21 Thread Ángel González
On 21/02/12 15:54, Bostjan Skufca wrote: Hi all, we've bumped into a possible bug where file_get_contents() returns empty string if we try to get contents from HTTPS source. This error only occurs if PHP is compiled with --with-curlwrappers. Funny thing is this only happens on slackware

Re: [PHP-DEV] Exceptions for method on non-object rather than fatal (desired feature?)

2012-02-21 Thread Ángel González
On 21/02/12 17:06, Ralf Lang wrote: Am 21.02.2012 16:55, schrieb Martin Amps: Could you not implement such functionality within your class as follows: class Family { public function getMother() { if ($this-hasMother()) return $someObj; else

Re: [PHP-DEV] Exceptions for method on non-object rather than fatal (desired feature?)

2012-02-21 Thread Ángel González
On 21/02/12 19:03, Ralf Lang wrote: I see no reason why it would be not desirable to have PHP raise the exception rather than putting more or less repeating code snippets all around the place. That is why I am asking. You must be returning false/null somewhere. It's the same effort to

Re: [PHP-DEV] [RFC] Enum proposal (yet another)

2012-02-22 Thread Ángel González
On 22/02/12 09:37, Sebastian Krebs wrote: class MyEnum { const FOO = 'foo'; const BAR = 'bar'; private $value; public function __construct ($value) { if (!in_array($value, array(self::FOO, self::BAR)) throw new UnexpectedValueException; $this-value = $value;

Re: [PHP-DEV] $_PARAMETERS Super Global Object

2012-02-22 Thread Ángel González
On 22/02/12 15:57, Michael Morris wrote: Before writing up a full RFC I want to put out a feeler on something. Currently we have several input parameter objects, chief among them $_GET, $_POST, $_REQUEST, $_SERVER (for the client HTTP headers). All of them are arrays and legacy code sometimes

Re: [PHP-DEV] [RFC] Enum proposal (yet another)

2012-02-22 Thread Ángel González
Am 22.02.2012 22:30, schrieb Sebastian Krebs: Am 22.02.2012 22:22, schrieb Ángel González: I want to call it doSomething(FOO) or doSomething(MyEnum::FOO), not doSomething(new MyEnum(MyEnum::FOO)); // The class file class MyEnum { public static $FOO; public static $BAR

Re: [PHP-DEV] [RFC] Enum proposal (yet another)

2012-02-22 Thread Ángel González
On 22/02/12 23:13, Kris Craig wrote: While I'm a huge fan of Github, why did you decide to host your RFC there instead of on the PHP wiki? (...) Samuel doesn't have a wiki accout. I agree he should get one and continue the proposal there. -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] [RFC] Enum proposal (yet another)

2012-02-23 Thread Ángel González
On 23/02/12 00:09, Stas Malyshev wrote: Hi! Sidenote, according your examples above on how you want call functions: Considered using normal constants? How can I do type hinting with them? You should not. PHP is not a strictly typed language, so if you want strictly typed function you'll

Re: [PHP-DEV] [RFC] Enum proposal (yet another)

2012-02-23 Thread Ángel González
I don't see your point, Sebastian. And | $studipNamedVariable = Databases::Mysql; | // ... much code | database_select($stupidNamedVariable, $sql); is better? The problem here seems to be more the developer, that avoids the use of constants, then less the missing enums. You can obviously

Re: [PHP-DEV] [RFC] Enum proposal (yet another)

2012-02-23 Thread Ángel González
On 23/02/12 22:59, Kris Craig wrote: Could you elaborate on this? So long as that setting cannot be changed midway through a script or its includes (i.e. the stack must be all strict or all dynamic), I can't think of any reason why that would not be feasible. --Kris I'm afraid that would

Re: [PHP-DEV] [RFC] Enum proposal (yet another)

2012-02-23 Thread Ángel González
On 23/02/12 23:49, Kris Craig wrote: Yeah I agree, that was one of the things I listed under disadvantages lol. I guess my question is: Does this constitute a prohibitive problem, or is it something that we can stomach? I mean, if you think about it, that's really what we're talking about

Re: [PHP-DEV] [RFC] Enum proposal (yet another)

2012-02-24 Thread Ángel González
On 24/02/12 00:36, Kris Craig wrote: Hmm that's a fascinating idea! So, and please correct me if I'm wrong, you're saying that it might be a better approach to determine strict vs. dynamic typing on a per file or function basis instead of on a per stack basis? In other words, blah.php could

Re: [PHP-DEV] Re: internals Digest 22 Feb 2012 22:13:24 -0000 Issue 2561

2012-02-24 Thread Ángel González
On 24/02/12 17:46, Dmitri Snytkine wrote: In order to intoduce the enum into php, 'enum' will have to be a keyword like 'class', 'interface', etc. Just a thought, but could there be a problem with using the new keyword 'enum' in php. I don't think it's currently a reserved word, so it

Re: [PHP-DEV] [RFC] Enum proposal (yet another)

2012-02-24 Thread Ángel González
On 24/02/12 19:35, Kris Craig wrote: Could you elaborate on that a little? I.e. as an interface for the call. I'm not sure what you mean by that. If you could provide a quick example, that would be awesome! =) --Kris Hi Kris, You're right it wasn't clearly expresseded. Lets see if I can

Re: [PHP-DEV] Object Casting - An Alternative to Type Hinting

2012-02-26 Thread Ángel González
On 26/02/12 15:57, Anthony Ferrara wrote: I've gone back and re-read a bunch of the old posts on Type Hinting, and have come to the conclusion that it won't be done any time soon. Not because it doesn't have merit, but because there are at least a few fundamental difficulties that are

  1   2   >