Re: [PHP-DEV] Providing sandboxed versions of include and require language constructs

2012-03-07 Thread Ángel González
On 07/03/12 00:04, Adam Jon Richardson wrote: It would be the responsibility of the framework or CMS or application to protect against this type of attack (which they do quite well.) When you can force a plugin to work through your API, you can take appropriate measures. When the plugin can

Re: [PHP-DEV] '?=' with PHP5.3.10

2012-03-07 Thread Ángel González
El 07/03/12 00:15, Kris Craig wrote: To clarify again, I was under the mistaken impression that ?= was a new alias for short_open_tag. My argument was (and still is) against short_open_tag. I do see some use in this new echo alias for templating purposes.

Re: [PHP-DEV] Providing sandboxed versions of include and require language constructs

2012-03-06 Thread Ángel González
On 06/03/12 14:04, Adam Jon Richardson wrote: The sandbox I'm considering would only impact the ability to directly call internal functions. The idea rests on the hope that the framework or CMS provides a security model that protects the integrity of their own environment. The framework can

Re: [PHP-DEV] consider reverting E_ALL with E_STRICT

2012-03-06 Thread Ángel González
On 06/03/12 17:08, Alan Knowles wrote: I just got caught on a production server with the 5.4 upgrade on debian, pretty much everything works fine, except the E_ALL change. I have to admit I missed the discussion where it was added, and searching for E_ALL or E_STRICT on marc is pretty

Re: [PHP-DEV] '?=' with PHP5.3.10

2012-03-06 Thread Ángel González
On 06/03/12 19:36, Kris Craig wrote: nitpicking mode=on FIRST: do NOT top post after get a reply below your text or how do you imagine that anybody can follow a thread where answers randomly before and after the quotet text? Sorry. Sometimes I forget that there are some people out there

Re: [PHP-DEV] [RFC] Namespace and Parse tags on Include and Require

2012-03-06 Thread Ángel González
On 06/03/12 15:45, Michael Morris wrote: I have made a wiki account with user name MichaelMorris - I don't think I have permissions to submit an RFC as of yet. I'll post this here for now. I've brought this up before, but can now simplify the original proposal since the decision to always

Re: [PHP-DEV] [RFC] Namespace and Parse tags on Include and Require

2012-03-06 Thread Ángel González
On 06/03/12 23:08, Michael Morris wrote: 2012/3/6 Ángel González keis...@gmail.com: Tagless files interpreted as php is the wrong way to go. I think you should instead propose it as: * A file included in that mode MUST begin with ?php. * ? is forbidden in such mode unless followed by EOF

Re: [PHP-DEV] get_magic_quotes_* != deprecated?

2012-03-03 Thread Ángel González
On 02/03/12 02:56, Philip Olson wrote: Hello! Please clarify whether or not get_magic_quotes_gpc() and get_magic_quotes_runtime() are deprecated, because I do not think they are. Deprecated means people should not use them while writing new code, but they are perfectly sensible

Re: [PHP-DEV] PHP 5.4.0 released!

2012-03-01 Thread Ángel González
On 02/03/12 01:00, Simon Schick wrote: Hi, all When will the documentation be ready? For example you wrote that something has changed to the keywords *continue *and *break *- but I dont get what and it's not defined in here: http://www.php.net/manual/en/control-structures.continue.php

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

2012-02-27 Thread Ángel González
On 27/02/12 16:12, Richard Lynch wrote: Oh, and string is a reserved word, so this won't work as-is, though that's obviously picuyane. It's not, you can perfectly define your own class called 'string'. I'd be much easier if it were, though. -- PHP Internals - PHP Runtime Development Mailing

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

2012-02-27 Thread Ángel González
On 27/02/12 01:33, Kris Craig wrote: Exactly, hence why I'm still on the fence with that. I was hoping for some further discussion though to see if anyone can think of a way around that, though admittedly nothing comes to my mind. --Kris That's why I mentioned the possibility of having such

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

2012-02-27 Thread Ángel González
On 27/02/12 02:44, John Crenshaw wrote: If we can agree on some basic terminology I think it would move things forward considerably. I propose these terms: - Strict Typing means the super strict old C style typing that has been proven to be ridiculous in this environment because of the

Re: [PHP-DEV] Scalar type hinting

2012-02-27 Thread Ángel González
On 27/02/12 17:19, Richard Lynch wrote: PRESUMPTION: *ANY* strict datatype could also be NULL, to represent a failure condition... Otherwise, when you are out of RAM: strict $o = new Object(); //violates strict, because Object HAS to be NULL, as there is no RAM left for it to be an object.

Re: [PHP-DEV] Scalar type hinting

2012-02-27 Thread Ángel González
On 27/02/12 16:47, Paul Dragoonis wrote: 2012/2/27 Johannes Schlüter johan...@schlueters.de Hi, PHP is no strickt-typed language. Changing this is a massive change, if you want to go there: There are plenty of other languages. If you want this to be an optional feature: a) It's not

Re: [PHP-DEV] Scalar type hinting

2012-02-27 Thread Ángel González
On 27/02/12 20:05, Richard Lynch wrote: You are correct. I'd have to come up with some OTHER scenario not involving fatal error, such as: strict $db = new DB(); and your database being down, unavailable, or connection parameters being wrong. The principle remains. You probably still

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

2012-02-27 Thread Ángel González
On 27/02/12 19:22, Richard Lynch wrote: I'm not so sure about that. In a well-written web application, you would typically convert them on the first layer, when receiving from the web. On next usages, your int variables are usually ints already. Afraid not. It turns out that PHP, on 32-bit

Re: [PHP-DEV] Scalar type hinting

2012-02-27 Thread Ángel González
On 27/02/12 22:52, Anthony Ferrara wrote: Ferenc, Thanks for the comments! Thanks from me, too. And thanks to you, Anthony if you get to summarise that. There were ideas, but they didn't have enough traction. IMO we can't have a proper solution without changing the existing behavior for

Re: [PHP-DEV] Scalar type hinting

2012-02-27 Thread Ángel González
Kris, go out for a walk. We don't need fake stress after the real one :) Yes, it's midnight here, but who cares? That you are afraid of going out at night? Because you had a bad experience with a serial killer? Oh, well... PS: This is what I called 'sane weak typing' in the other thread before

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

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

2012-02-26 Thread Ángel González
On 26/02/12 05:11, Arvids Godjuks wrote: Kris Craig I usually just read the list, sometimes add if I have something to say and I had voiced my opinion on typehinting before. And you know, just from the stand of a userland developer who has 7-8 years of experience and devoting myself to the

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

2012-02-26 Thread Ángel González
I just realised that if it were going to add magic casting, it could as well be done with a spl_autocast_register(), so that you could either cast things when they match, throw an exception, etc. (there should be some default value dynamic typing, so the perfomance wouldn't hurt) . I don't think

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] [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-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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] [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] 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] 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] 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] 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] 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] [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] 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] 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] 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] 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] 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] [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] [RFC] Magic Quotes in PHP, the Finalle

2011-07-18 Thread Ángel González
Derick Rethans wrote: Raise E_DEPRECATED when running the CGI or any web server SAPI and a php.ini file does not contain “magic_quotes_gpc = Off”. and Raise E_ERROR when running the CGI or any web server SAPI and a php.ini file does not contain “magic_quotes_gpc = Off”. Doesn't that mean that

Re: [PHP-DEV] unexpected modification of a variable

2011-06-29 Thread Ángel González
Pascal COURTOIS wrote: Hi, Is there any way that a variable can be changed within a function without passing it by reference ? I have a code like that: function myfunction($var) { some code print_r($var); = prints $var which is an object anotherfunction($var); // call by value

Re: [PHP-DEV] BC-BREAK at 5.2.7

2011-05-27 Thread Ángel González
Lars Schultz wrote: Hi internals, Jani told me to ask the list about this. I tried commenting on the bug but I guess since it's closed, no one cares about it anymore. http://bugs.php.net/bug.php?id=49189 This Change prevents us to move to anything beyond this bugfix with our codebase and

Re: [PHP-DEV] Call non-static method staticly raise E_STRICT, but why call a static method instancely won't

2011-04-24 Thread Ángel González
reeze wrote: Hi, I am not sure it's the right place to discuss this. someday I found I call a static method _instancely_. the method is just a helper method when reviewing my code. I know I do the wrong thing, but PHP doesn't complain about it. then I do some tests like below: A few

Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-16 Thread Ángel González
Ben Schmidt wrote: $var = $arr['key'] ?? : 'empty'; Also note this is possible with the recent proposal Hannes and I were discussing. It simply looks like $var = $arr?['key'] ?: 'empty'; The ?[ avoids notices and the ?: works as it always has. Ben. If it was going to be ?[, I'd much

Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-09 Thread Ángel González
Sanford Whiteman wrote: Same here. Here's my take: [1] I don't like ?? / ? because it is disjunctive with === / ==.. The extra equals sign strengthens equality comparison, while the extra question mark essentially _weakens_ the ternary operator (making it more forgiving). (Sure, a

Re: [PHP-DEV] Package php binaries + php script into one single executable file

2011-03-16 Thread Ángel González
Olivier Hoareau wrote: I don't think that people are gonna like that kind of approach, having two binaries with one of them coming from custom source should raise some concerns and you won't like the prospects of maintaining PHP for older Debian/Ubuntu versions. My users currently does not

Re: [PHP-DEV] Package php binaries + php script into one singleexecutable file

2011-03-16 Thread Ángel González
Alec wrote: I actually wrote that. I never imagined someone would actually find that useful! If you don't mind having a few external dlls, you can use dl (ick!) to load the extensions. I gave up supporting that because compiling the custom lightweight stubs took more work than I cared for.

Re: [PHP-DEV] RFC: built-in web server in CLI.

2011-03-03 Thread Ángel González
Moriyoshi Koizumi wrote: Regarding the patch (https://gist.github.com/835698): I don't see a switch to disable the internal parse on configure. I don't see any obvious reason it should be able to be turned off through the build option. The only problem is binary size increase, which I guess

Re: [PHP-DEV] RFC: built-in web server in CLI.

2011-03-02 Thread Ángel González
Moriyoshi Koizumi wrote: Hi, Just to let you know that I wrote a RFC about built-in web server feature with which PHP can serve contents without a help of web servers. That would be handy for development purpose. If interested, have a look at http://wiki.php.net/rfc/builtinwebserver .

Re: [PHP-DEV] Volnitsky substring search algo

2011-03-02 Thread Ángel González
Stas Malyshev wrote: Hi! http://volnitsky.com/project/str_search/ I'm not sure it'd be easy to integrate this into PHP codebase as-is, provided it relies on C++ standard libraries which PHP makes no use of (and thus potentially introduces a world of dependencies and complexities into the

Re: [PHP-DEV] Experiments with a threading library for Zend: spawning a new executor

2011-01-19 Thread Ángel González
Have you taken a look at Runkit_Sandbox? It may provide useful tips. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Experiments with a threading library for Zend: spawning a new executor

2011-01-19 Thread Ángel González
On 19/01/11 23:10, Sam Vilain wrote: On 20/01/11 10:17, Ángel González wrote: Have you taken a look at Runkit_Sandbox? It may provide useful tips. *headdesk* No, I hadn't seen that. Thanks for pointing this out, it looks like exactly what I was trying to reinvent... Cheers, Sam. You may

Re: [PHP-DEV] [PATCH] Add option to disable POST data processing

2010-12-16 Thread Ángel González
Gustavo Lopes wrote: I know you're responding to Pierre's proposed addition of a way to disable POST data handling altogether possibly via an ini option, but since the objection also applies to the ini option I've added to trunk, I'd like to address it. Yes, it sucks that the option cannot

Re: [PHP-DEV] [PATCH] Add option to disable POST data processing

2010-12-16 Thread Ángel González
Gustavo Lopes wrote: I've committed to trunk the patch with the name of the ini option changed from disable_post_data_processing to enable_post_data_reading. Pierre Joye wrote: hi, The more I look at this option the more I think it is confusing. I'm not sure the gain is worth this

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Ángel González
Andrey Hristov wrote: I am not against global variables, I'm against usage of $GLOBALS and global. So how do you support global variables by banning the two ways they can be accessed? -1 From a Framework point of view, they should save all of the (super)global variables from the global

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Ángel González
Andrey Hristov wrote: Ángel González wrote: So how do you support global variables by banning the two ways they can be accessed? very easy, by using them by name. Global variables are those outside of a classes, methods and functions. If they can only be used outside functions they would

Re: [PHP-DEV] Deprecating global + $GLOBALS, making $_REQUEST, $_GET, $_POST read-only

2010-12-09 Thread Ángel González
On Thu, Dec 9, 2010 at 11:42, Michael Shadle wrote: Not to mention, I have had issues (and I can't reproduce it properly or I would report it) where sometimes i will have a variable in global scope in one file, and I have to reference it as $GLOBALS['variable'] in another include, or I have

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-12-01 Thread Ángel González
presid...@basnetworks.net wrote: I feel that the downfall of this syntax, is that the get and set methods can easily be scattered at either end of a class definition. With the syntaxes I provided, it is easy to tell which of the methods a property has defined at a quick glance, because

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-30 Thread Ángel González
Richard Quadling wrote: (I assume the variable has to be part of the current class or one of its parents?) Yes. I don't think it makes sense to have a class property actually read a global. If a project really need it (eg. some migration from procedural style to classes), then use the verbose

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Ángel González
Richard Quadling wrote: I'd really like this feature to be part of PHP. I don't particularly like the use of what looks like a closure for the set/get. I used to code in Delphi and I always like the way in which their properties were defined. Essentially, the setter and getter are normal

Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP

2010-11-29 Thread Ángel González
Richard Quadling wrote: As for reading $seconds directly ... Well. If you think of the element that follows read as $this-, then if the parser can handle both ... read $seconds read getSeconds then yes for both. If not, then I'd guess that the getSeconds version should be the one

Re: [PHP-DEV] RFC: Making T_FUNCTION optional in method declarations

2010-11-28 Thread Ángel González
Derick Rethans wrote: On Sat, 27 Nov 2010, Johannes Schlüter wrote: RFC: http://wiki.php.net/rfc/optional-t-function Patch: http://schlueters.de/~johannes/php/zend_optional_t_function.diff I'm -1 on this one. Besides this being confusing for people who want to run newer code on older PHP

Re: [PHP-DEV] RFC: Making T_FUNCTION optional in method declarations

2010-11-28 Thread Ángel González
Dallas Gutauckis wrote: Just to be clear, this works on the assumption that we don't know the class name that the function resides in? I understand the search argument, but to me it only applies to functions, not methods. Is anyone arguing for removing the T_FUNCTION requirement on

Re: [PHP-DEV] [FPM] when to call extensions MINIT and MSHUTDOWN

2010-11-11 Thread Ángel González
Jérôme Loyet wrote: Hi guys, I'm sure when FPM should call extensions MINIT and MSHUTDOWN functions. MINIT is called once by the master process after it forks any children. It's done by calling php_module_startup() in cgi_sapi_module.startup(). MSHUTDOWN is also called by the master

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

<    1   2