Re: [PHP-DEV] Support for writing and executing compiled opcode

2015-11-13 Thread Rasmus Lerdorf
On Nov 13, 2015, at 17:00, Stephen Coakley wrote: > >> On 11/13/2015 03:45 PM, Sebastian Bergmann wrote: >>> On 11/13/2015 04:35 PM, Stephen Coakley wrote: >>> This is quite similar to Python's ability to execute Python scripts >>> compiled to bytecode as *.pyc files. The feature has seen great >

Re: [PHP-DEV] PHP 7 RTM date

2015-11-09 Thread Rasmus Lerdorf
On 11/09/2015 04:20 PM, David Zuelke wrote: > November 30 is Cyber Monday, where people are either > > a) focused on maxing out their credit cards on every possible e-commerce > site, or > b) unable to roll out PHP 7 because their customers are busy with a) > > At least at Heroku we have a black

Re: [PHP-DEV] PHP 7 RTM date

2015-11-08 Thread Rasmus Lerdorf
On 11/08/2015 05:16 PM, Anatol Belski wrote: > Exactly, the relevant patches are going into RC7 which is then out on 12th > instead of GA. The next closest release slot were then Nov 26th, either for > GA or for RC8 (but better not try to predict). If it stands good, we might > have no reason to wa

Re: [PHP-DEV] PHP 7 RTM date

2015-11-08 Thread Rasmus Lerdorf
On 11/08/2015 11:15 AM, Anatol Belski wrote: > Hi, > > After doing the last evaluations in the RMs circle before going for 7.0.0 > RTM preparations, we came to the conclusion that the current state does not > look reasonable to be packaged as the final release. > > The RCs before RC6 was looking

Re: [PHP-DEV] [VOTE] Void Return Type RFC

2015-10-29 Thread Rasmus Lerdorf
On 10/29/2015 08:55 PM, Stanislav Malyshev wrote: > Hi! > >> "void" or "null" as return type would give a 100% guarantee that every >> possible >> implementation of a given interface won't return any random value. Then it >> would >> make no difference if the returned value is being used or not,

Re: [PHP-DEV] Re: [PHP-CVS] com php-src: Added an experemental ability to move PHP code pages (PHP TEXT segment) into HUGE pages. PHP should be configured and built with --enable-huge-code-pages, OS s

2015-09-15 Thread Rasmus Lerdorf
On 09/14/2015 11:58 PM, Dmitry Stogov wrote: > On Tue, Sep 15, 2015 at 4:31 AM, Rasmus Lerdorf <mailto:ras...@lerdorf.com>> wrote: > Redhat enables THP by default and has for a while, but I know lots of > admins that disable this feature right away on production machi

Re: [PHP-DEV] Re: [PHP-CVS] com php-src: Added an experemental ability to move PHP code pages (PHP TEXT segment) into HUGE pages. PHP should be configured and built with --enable-huge-code-pages, OS s

2015-09-14 Thread Rasmus Lerdorf
On 09/14/2015 02:13 PM, Anatol Belski wrote: > > >> -Original Message- >> From: Dmitry Stogov [mailto:dmi...@zend.com] >> Sent: Monday, September 14, 2015 10:37 PM >> To: Anatol Belski >> Cc: Anatol Belski ; Kalle Sommer Nielsen ; >> Rasmus Lerd

Re: [PHP-DEV] [RFC] [Discussion] Short Closures

2015-08-31 Thread Rasmus Lerdorf
> On Aug 31, 2015, at 18:04, Bob Weinand wrote: > > From the RFC: >> all variables used in the body of the anonymous function will automatically >> be bound to the anonymous function closure from the defining scope > > The implementation is not capturing all the variables from the outer scope,

Re: [PHP-DEV] Recap - Core functions throwing exceptions in PHP7

2015-08-21 Thread Rasmus Lerdorf
On 08/21/2015 06:36 AM, Anthony Ferrara wrote: > My proposal/stance: > > Let's make random_* throw an Exception if it cannot connect to a > random source. And let's have it throw an TypeError if ZPP fails, or > Error if min >= max. > > The first two are consistent with existing exceptions. I don

Re: [PHP-DEV] Introductions

2015-07-13 Thread Rasmus Lerdorf
On 07/13/2015 11:23 AM, Matt Tait wrote: > Hi all, > > I'm Matt Tait; a security researcher at Google, and I'm quite interested in > looking at and helping to build new security-related features within PHP; > i.e. features that reduce the likelihood that deployments of PHP end up > being hacked. >

Re: AW: [PHP-DEV] PHP7 and types

2015-07-13 Thread Rasmus Lerdorf
On 07/13/2015 12:16 AM, Robert Stoll wrote: > Another point of discussion should be how strict a property type hint will > be. Currently, parameter type hints are only binding for the call side but > not within the function body. > For instance, function foo(Foo $x){ $x = 1;} is perfectly valid.

Re: [PHP-DEV] PHP7 and types

2015-07-12 Thread Rasmus Lerdorf
On 07/12/2015 05:12 PM, Rasmus Lerdorf wrote: > On 07/12/2015 12:37 PM, Larry Garfield wrote: >> I don't know why we're even talking about IDEs here. IDE >> auto-completion isn't the point, anymore than it was the point for >> scalar type hints or return type h

Re: [PHP-DEV] PHP7 and types

2015-07-12 Thread Rasmus Lerdorf
On 07/12/2015 12:37 PM, Larry Garfield wrote: > I don't know why we're even talking about IDEs here. IDE > auto-completion isn't the point, anymore than it was the point for > scalar type hints or return type hints. It's about the language doing > type checking for you and static analysis, so tha

Re: [PHP-DEV] New PHP SAPI for Nginx

2015-06-25 Thread Rasmus Lerdorf
On 06/25/2015 01:31 PM, S.A.N wrote: > New versions Nginx, implement thread pools, > http://nginx.com/blog/thread-pools-boost-performance-9x/ > > I think this is a good opportunity to write a Nginx module (PHP SAPI) > which is to process requests for PHP scripts in processes Nginx. > > Quality ad

Re: [PHP-DEV] hasType() for internal function parameters?

2015-06-22 Thread Rasmus Lerdorf
On 06/22/2015 11:51 PM, Stanislav Malyshev wrote: > Hi! > >> Is it a BC break against real code though? Fixing tests isn't a >> big deal. What kind of real code would break by turning calls with >> the wrong number of args from an error to a warning? > > Well, if we move to checking in ZPP only,

Re: [PHP-DEV] hasType() for internal function parameters?

2015-06-22 Thread Rasmus Lerdorf
On 06/22/2015 07:54 PM, Stanislav Malyshev wrote: > Hi! > > So I tried to remove the checks for ZEND_ACC_HAS_TYPE_HINTS: > https://github.com/php/php-src/pull/1354 > > Turns out there is a lot of tests that assume function with wrong > arguments throws Error, but ZPP and type checks work differen

Re: [PHP-DEV] hasType() for internal function parameters?

2015-06-22 Thread Rasmus Lerdorf
On 06/22/2015 03:00 PM, Dmitry Stogov wrote: > > > On Mon, Jun 22, 2015 at 8:35 PM, Rasmus Lerdorf <mailto:ras...@lerdorf.com>> wrote: > > On 06/22/2015 01:27 PM, Dmitry Stogov wrote: > > Actually, when you added type hints, php compiler stoppe

Re: [PHP-DEV] hasType() for internal function parameters?

2015-06-22 Thread Rasmus Lerdorf
On 06/22/2015 01:27 PM, Dmitry Stogov wrote: > Actually, when you added type hints, php compiler stopped optimizing and > using ZEND_DEFINED (and others) instead of internal function calls, but > of course this shouldn't change behavior. I'll need to take a look into > difference. Right, behaviour

Re: [PHP-DEV] hasType() for internal function parameters?

2015-06-22 Thread Rasmus Lerdorf
On 06/22/2015 05:11 AM, Dmitry Stogov wrote: > Hi Rasmus, > > Your latest changes broke more than 100 tests. > Sorry, but I had to revert your commits and related Bob's fixes. > You may find them in internal-arg-info branch. > > Please, don't do experiments on the common code base at beta stage.

Re: [PHP-DEV] hasType() for internal function parameters?

2015-06-21 Thread Rasmus Lerdorf
On 06/21/2015 06:11 PM, Stanislav Malyshev wrote: > Hi! > >> Before making more extensive use of arginfo types, I think we should first >> do some adjustments to the way they are handled. In particular adding types >> means that internal fcalls will take the branch in >> http://lxr.php.net/xref/PH

Re: [PHP-DEV] hasType() for internal function parameters?

2015-06-21 Thread Rasmus Lerdorf
On 06/21/2015 03:40 PM, Kalle Sommer Nielsen wrote: > Hi > > 2015-06-21 20:58 GMT+02:00 Rasmus Lerdorf : >> Or we bite the bullet and fix the arginfo everywhere to make it >> consistent. It wouldn't be that hard to write a script to generate the >> bulk of it. &g

Re: [PHP-DEV] hasType() for internal function parameters?

2015-06-21 Thread Rasmus Lerdorf
On 06/21/2015 02:44 PM, Nikita Popov wrote: > The difference here is that ustrlen() has an argument type specified in > arginfo, while strlen() triggers an error through > zend_parse_parameters(). We have practically no arginfo-level type > annotations in the standard library. Obviously we can't l

[PHP-DEV] hasType() for internal function parameters?

2015-06-21 Thread Rasmus Lerdorf
Is it deliberate that we are not providing the parameter types for internal functions via reflection? It seems inconsistent: getParameters()[0]; $param_strlen = (new ReflectionFunction('strlen'))->getParameters()[0]; echo "$param_ustrlen (".$param_ustrlen->hasType().")\n"; echo "$

Re: [PHP-DEV] PHP-FPM: How to clear the realpath cache on deployment?

2015-06-19 Thread Rasmus Lerdorf
On 06/19/2015 08:43 AM, Sebastian Bergmann wrote: > Scenario: nginx + PHP-FPM / FastCGI. > > The final step of the deployment is updating a symlink to point to the > new version. > > For N <= realpath_cache_ttl seconds after the deployment, some > filesystem operations fail because of outdat

Re: [PHP-DEV] PHP 7.0.0alpha1 Released for Testing!

2015-06-13 Thread Rasmus Lerdorf
> On Jun 13, 2015, at 14:54, Jan Ehrhardt wrote: > > Rasmus Lerdorf in php.internals (Fri, 12 Jun 2015 13:13:16 -0700): >> You can get even more speed by compiling with --enable-opcache-file and >> then in your php-cli.ini add: >> >> opcache.enable_cli=1

Re: [PHP-DEV] PHP 7.0.0alpha1 Released for Testing!

2015-06-12 Thread Rasmus Lerdorf
On 06/12/2015 01:08 PM, Anatol Belski wrote: > Hi Jordi, > >> -Original Message- >> From: Jordi Boggiano [mailto:j.boggi...@seld.be] >> Sent: Friday, June 12, 2015 3:03 PM >> To: internals@lists.php.net >> Subject: Re: [PHP-DEV] PHP 7.0.0alpha1 Released for Testing! >> >> On 12/06/2015 01:

Re: [PHP-DEV] Request for php-src karma

2015-06-10 Thread Rasmus Lerdorf
On 06/10/2015 03:25 PM, Christoph Becker wrote: > Hi! > > I'm requesting php-src karma (cmb@), mainly for bug-fix purposes. I > have already submitted several PRs[1], and several of them have already > been merged. > > It seems to me that it might save time, if I can commit obvious and > uncontr

[PHP-DEV] Re: [PHP-CVS] com php-src: Add targets to simplify building PHP with FDO (Feedback Directed Optimisation) PHP should be built with the folowing steps:: Makefile.global configure.in

2015-05-26 Thread Rasmus Lerdorf
On 05/26/2015 07:33 AM, Dmitry Stogov wrote: > Commit:7dac4d449f72d7eb029aa1a8ee87aaf38e17e1c5 > Author:Dmitry Stogov Tue, 26 May 2015 17:33:25 > +0300 > Parents: ca31711625095c2d6e308d7f0fc9d371ad0934d4 > Branches: master > > Link: > http://git.php.net/?p=php-src.git;a

Re: [PHP-DEV] Re: Maintaining PHP LDAP module

2015-05-05 Thread Rasmus Lerdorf
On 05/05/2015 05:50 AM, Côme BERNIGAUD wrote: > On 2015-05-05 14:26, Christoph Becker wrote: >> It might be useful to state some references, such as already submitted >> patches or pull requests, for instance. > I posted a patch here: https://bugs.php.net/bug.php?id=69471 > > I did not send anythi

Re: [PHP-DEV] Deprecate setlocale?

2015-04-02 Thread Rasmus Lerdorf
On 04/02/2015 02:13 PM, Dan Ackroyd wrote: > Adam Harvey wrote: >> What about just adding another function: setlocale_global(), or similar? > > Do you mean setlocale would become the thread safe one, and > setlocale_global() would be the current behaviour? If so, that would > be a BC break for the

Re: [PHP-DEV] Deprecate setlocale?

2015-04-02 Thread Rasmus Lerdorf
On 04/01/2015 09:15 AM, Dan Ackroyd wrote: > Hi, > > I'd like to get people's feedback for the idea of making setlocale be > either deprecated and to be removed eventually or just increasing the > warning level against people using it. > > The short version of why we should do this is that setloc

Re: [PHP-DEV] Use "ropes" for string concatenation

2015-03-24 Thread Rasmus Lerdorf
On 03/23/2015 11:14 PM, Xinchen Hui wrote: >>> from user land. this won't change anything.. >> >> Nothing to do with userland or not but code stabilization > In that case, yeah. you might be right. > > but from my opinion, simpler always means easier for maintaining > > anyway, I hope this

Re: [PHP-DEV] Proposal to delay 7.0 timeline

2015-03-21 Thread Rasmus Lerdorf
On 03/21/2015 08:52 AM, François Laupretre wrote: > Now, after more calls from many of you to delay it, and as Zeev himself > seemed to consider it as more acceptable, I am proposing again to delay 7.0 > feature freeze to May, 15 (2 month delay, date where vote is starting). I > won’t repeat all th

Re: [PHP-DEV] [Q] Does PHP have a negative cache for file stat operations?

2015-03-19 Thread Rasmus Lerdorf
On 03/19/2015 01:26 PM, Eric Stenson wrote: > PHP Internals folks-- > > We're doing some performance work in WinCache, and we're finding that some > frameworks are...uh...enthusiastically using file_exists(), is_file() and > is_dir() functions on files/directories that don't exist. Every. Singl

Re: [PHP-DEV] RE: [PHP-CVS] com php-src: Enable GCC global register variables if available: Zend/Zend.m4 Zend/zend_execute.c

2015-03-17 Thread Rasmus Lerdorf
> Diff: > diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 > index 16f2d5f..e12b00d 100644 > --- a/Zend/Zend.m4 > +++ b/Zend/Zend.m4 > @@ -409,3 +409,48 @@ else > AC_MSG_RESULT(no) >fi > fi > + > +AC_ARG_ENABLE(gcc-global-regs, > +[ --disable-gcc-global-regs > + whether

Re: [PHP-DEV] [RFC][PRE-VOTE] Reserving More Types in PHP 7

2015-03-14 Thread Rasmus Lerdorf
On 03/15/2015 09:41 AM, Niklas Keller wrote: > Rasmus, the context sensitive lexer doesn't change anything for Drupal. > Support for class names has been dropped, > see https://wiki.php.net/rfc/context_sensitive_lexer#rejected_features Yes, I realize that. I just mentioned Drupal as an example of

Re: [PHP-DEV] [RFC][PRE-VOTE] Reserving More Types in PHP 7

2015-03-14 Thread Rasmus Lerdorf
On 03/15/2015 07:31 AM, Philip Sturgeon wrote: > On Sat, Mar 14, 2015 at 7:38 AM, Bob Weinand wrote: >>> Am 14.03.2015 um 10:21 schrieb Pavel Kouřil : >>> >>> On Saturday, March 14, 2015, Levi Morrison wrote: RFC Link: https://wiki.php.net/rfc/reserve_more_types_in_php_7 The propos

Re: [PHP-DEV] [VOTE][RFC] Coercive Scalar Type Hints

2015-03-13 Thread Rasmus Lerdorf
On Mar 14, 2015, at 13:37, Levi Morrison wrote: > It seems that `float -> bool` is always disallowed. If I am correct > `int -> bool` is permitted for all values (not just 0 and 1), which > means that floats which can be converted to integers without dataloss > should also be permitted to be boole

Re: [PHP-DEV] Is OpCache enabled by default in php 5.5 and later or not?

2015-03-05 Thread Rasmus Lerdorf
On 03/05/2015 08:12 AM, j adams wrote: > I don't know if this is a question for the documentation team or not, but > figured I'd start here. There does not appear to be any definitive, clear, > reliable information on PHP's op caching functionality in recent 5.* > versions and this problem needs to

Re: [PHP-DEV] Consistent function names

2015-03-04 Thread Rasmus Lerdorf
On 03/04/2015 10:21 PM, Yasuo Ohgaki wrote: > The same could be done for new names. > Manual pages for localtime()/mktime()/etc would look a lot nicer. > I hope there will be more favored developers with the RFC. Since I'm > going to > update manual to have alias search feature, developers used to

Re: [PHP-DEV] Consistent function names

2015-03-04 Thread Rasmus Lerdorf
On 03/04/2015 08:25 PM, Yasuo Ohgaki wrote: > Hi Rasmus, > > On Thu, Mar 5, 2015 at 1:46 AM, Rasmus Lerdorf <mailto:ras...@lerdorf.com>> wrote: > > On 03/04/2015 08:26 AM, guilhermebla...@gmail.com > <mailto:guilhermebla...@gmail.com> wrote: > &g

Re: [PHP-DEV] Consistent function names

2015-03-04 Thread Rasmus Lerdorf
On 03/04/2015 08:26 AM, guilhermebla...@gmail.com wrote: > @Rasmus: > > I don't see what's the problem of aliasing functions for the next 1-2 > majors, deprecate the inconsistent one in the following and remove later. As far as I am concerned str_len() would be the inconsistent one. Like I explai

Re: [PHP-DEV] Consistent function names

2015-03-04 Thread Rasmus Lerdorf
On 03/03/2015 07:34 PM, Yasuo Ohgaki wrote: > Hi Michael, > > On Wed, Mar 4, 2015 at 12:15 PM, Michael Schuett > wrote: > >> Your evaluation is pretty anecdotal. I agree with some points but you need >> some solid evidence if you are going to rate these languages. Also do you >> have a list of a

Re: [PHP-DEV] Consistent function names

2015-03-02 Thread Rasmus Lerdorf
On 03/02/2015 03:54 PM, Yasuo Ohgaki wrote: > Hi Markus, Larry and Rowan, > > On Tue, Mar 3, 2015 at 8:36 AM, Markus Fischer wrote: > >> On 03.03.15 00:10, Yasuo Ohgaki wrote: >>> I would love to have new & clean APIs. >>> >>> Please think my proposal as legacy API cleanups. Many of candidates w

Re: [PHP-DEV] A different user perspective on scalar type declarations

2015-02-26 Thread Rasmus Lerdorf
On 02/26/2015 10:49 AM, Dan Ackroyd wrote: > In most applications, the part of the code that is exposed to the > outside world and has to convert strings or unknown types into known > types is a very small layer at the outside edge of the application. > > The vast majority of code written for non-

Re: [PHP-DEV] Reviving scalar type hints

2015-02-20 Thread Rasmus Lerdorf
On 02/20/2015 10:52 AM, Josh Watzman wrote: > On Feb 20, 2015, at 10:30 AM, Rasmus Lerdorf wrote: >> Hack examples all using > >> echo number_format('1000'); >> echo htmlspecialchars(1000); >> echo md5(1000); >> >> These are all fine both a

Re: [PHP-DEV] Reviving scalar type hints

2015-02-20 Thread Rasmus Lerdorf
On 02/20/2015 09:39 AM, Anthony Ferrara wrote: > I think if anything, the appearance of Hack (and its adoption) show > that people want static typing, at least to some level... To be perfectly transparent here though, you should mention that your proposed RFC goes well beyond the strict typing tha

Re: [PHP-DEV] Digit separators for numeric literals

2015-02-19 Thread Rasmus Lerdorf
On 02/18/2015 11:49 PM, Michael Wallner wrote: > On 19/02/15 03:44, Rasmus Lerdorf wrote: > >> but _999_ would need to work as well and _ is a valid char in a constant >> so you can have a constant named _999_. >> > > Why would we need to support the underscore in

Re: [PHP-DEV] Digit separators for numeric literals

2015-02-18 Thread Rasmus Lerdorf
On 02/18/2015 11:21 PM, Rick Widmer wrote: > On 2/18/2015 7:44 PM, Rasmus Lerdorf wrote: >> Now if we went into Unicode territory, we could do it. eg. >> >>my_func(1 999 999) U+1680 (although it looks too much like a -) >>my_func(1 999 999) U+205F (mathem

Re: [PHP-DEV] Digit separators for numeric literals

2015-02-18 Thread Rasmus Lerdorf
On 02/18/2015 06:07 PM, Christoph Becker wrote: > Hi internals! > > A while ago a question was asked on the php-general mailing list with > regard to digit seperators in numeric literals[1]. > > IMHO it might be a useful enhancement to allow such digit separators for > numeric (integer and float)

Re: [PHP-DEV] Scalar Type Hints v0.4

2015-02-18 Thread Rasmus Lerdorf
On 02/18/2015 08:51 AM, François Laupretre wrote: >> De : Pádraic Brady [mailto:padraic.br...@gmail.com] >> >> Careful, it helps not to call folk "radicals" if you intend to pursue >> a compromise with them ;). > > Sorry, english is not my native language, and 'radical' may be offensive. > > I wa

Re: [PHP-DEV] Scalar Type Hints v0.4

2015-02-17 Thread Rasmus Lerdorf
On 02/17/2015 04:35 PM, Nikita Popov wrote: > I don't buy into Rasmus arguments about internal functions. They concern > one particular edge case (int->float coercion) and I doubt they have much > relevance if applied to codebases with pervasive use of typehints (where > you can be reasonably sure

Re: [PHP-DEV] Reviving scalar type hints

2015-02-17 Thread Rasmus Lerdorf
On 02/17/2015 08:38 AM, Sara Golemon wrote: > On Tue, Feb 17, 2015 at 12:22 AM, Rasmus Lerdorf wrote: >> Please correct me here if I somehow ran these incorrectly. I did put >> some deliberate type errors into my userspace code and hh_client caught >> those nicely, so it seem

Re: [PHP-DEV] Reviving scalar type hints

2015-02-17 Thread Rasmus Lerdorf
On 02/17/2015 01:11 AM, Benjamin Eberlei wrote: > I think curl_setopt is a misleading example in the typehinting > discussion, because > this kind of API does not benefit from it. The third argument depends > on the second argument and requires a "generic" type in code: > > curl_setopt(resource $c

Re: [PHP-DEV] Reviving scalar type hints

2015-02-17 Thread Rasmus Lerdorf
On 02/16/2015 09:48 PM, Sara Golemon wrote: > Second, I should clarify that while the HHVM runtime performs > coersion, the hack type checker is strict. So my original statement > was inaccurate. As far as hack is concerned, it's simply strict. > Period. With both the default (partial) type chec

Re: [PHP-DEV] Reviving scalar type hints

2015-02-16 Thread Rasmus Lerdorf
On 02/16/2015 05:57 PM, Sara Golemon wrote: > On Mon, Feb 16, 2015 at 4:52 PM, Rasmus Lerdorf wrote: >> I still disagree strongly that it serves everyone's needs. The internal >> API and APIs provided by extensions are completely messed up by this >> approach. Usersp

Re: [PHP-DEV] Reviving scalar type hints

2015-02-16 Thread Rasmus Lerdorf
On 02/16/2015 03:58 PM, Sara Golemon wrote: > On Mon, Feb 16, 2015 at 2:50 PM, François Laupretre wrote: >> Once again, anyone can take over version 0.3, if it is so great. Why don't >> you do it ? >> I will play the game, stop working on my proposal, and vote 'yes' again. >> But don't ask me to

Re: [PHP-DEV] Switch jumptable optimization

2015-02-16 Thread Rasmus Lerdorf
On 02/16/2015 03:47 PM, Bob Weinand wrote: >> Am 17.02.2015 um 00:30 schrieb Rasmus Lerdorf > <mailto:ras...@lerdorf.com>>: >> >> On 02/16/2015 03:04 PM, Bob Weinand wrote: >>> I'd like to show you my recent work on a jumptable optimization for >>

Re: [PHP-DEV] Switch jumptable optimization

2015-02-16 Thread Rasmus Lerdorf
On 02/16/2015 03:04 PM, Bob Weinand wrote: > I'd like to show you my recent work on a jumptable optimization for switches. > > https://github.com/php/php-src/pull/1048 > > > It is a fully transparent optimization of switches, by putting a new > ZEND_SW

Re: [PHP-DEV] [VOTE] Big Integer Support

2015-02-15 Thread Rasmus Lerdorf
On 02/15/2015 05:45 AM, Andrea Faulds wrote: > Hi, > >> On 15 Feb 2015, at 12:39, Xinchen Hui wrote: >> >> On Sun, Feb 15, 2015 at 10:46 AM, Andrea Faulds wrote: >>> Hi everyone, >>> >>> I should’ve done this a long time ago, but I’m going to hold a vote on this >>> RFC. The implementation isn’

Re: [PHP-DEV] PHP 7 snapshots?

2015-02-12 Thread Rasmus Lerdorf
On 02/12/2015 01:39 PM, Jacob Bednarz wrote: > Hi Internals, > > Late in January Rasmus sent out an email to test the PHP 7 build. I've > recently completed this with a few of our applications locally however > now I am looking to test these changes on one of our isolated > development environmen

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-10 Thread Rasmus Lerdorf
On 02/10/2015 07:57 PM, Xinchen Hui wrote: >> am I wrong?! > seems I am wrong with this, it's a false alarm... it can restore > automatically. Yeah, declare() doesn't span files so that isn't a problem. My worry is still the lack of type coercion for internal calls. I tested it on some apps and

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-07 Thread Rasmus Lerdorf
On 02/07/2015 09:51 PM, Andrea Faulds wrote: >> tan(1); >> echo strstr("test", "est", 1); > > Banning int->float and float->int is both a pain point and sometimes a > life-saver. It’s annoying that tan(1) doesn’t work. On the other hand, you > discover if your ints floats would be silently trunc

Re: [PHP-DEV] [VOTE] Scalar Type Hints

2015-02-07 Thread Rasmus Lerdorf
On 02/07/2015 05:03 PM, Pavel Kouřil wrote: > I'm wishing more and more that the RFC doesn't pass (even though I'd > LOVE to have typehints in PHP as a userland developer) and someone > else will make a better version of typehints RFC for PHP 7, because > this one feels really like you took an ok-

Re: [PHP-DEV] Annotated PHP 5->7 extension diff

2015-02-05 Thread Rasmus Lerdorf
On Feb 5, 2015, at 17:41, "guilhermebla...@gmail.com" wrote: > > Hi Rasmus, > > Thanks for the highlight. > My biggest concern about all this breakage done for NG could somehow be > minimized by providing possible alternate implementations that could work > both backwards compatible and forwa

[PHP-DEV] Annotated PHP 5->7 extension diff

2015-02-05 Thread Rasmus Lerdorf
We have had quite a number of changes to the extension API and it worries me a little bit how long it will take everyone to get their extensions ported. We have UPGRADING.INTERNALS which still needs some love, but even if that covered everything it is sometimes hard to match a bullet point in a lon

Re: [PHP-DEV] [VOTE] Add is_cacheable() stream-wrapper operation

2015-02-03 Thread Rasmus Lerdorf
On 02/02/2015 07:35 PM, David Muir wrote: > > >> On 3 Feb 2015, at 3:49 am, Rasmus Lerdorf wrote: >> >>> On 02/02/2015 08:38 AM, François Laupretre wrote: >>> Hi, >>> >>> Opening the vote for : >>> >>> https://wiki.php.

[PHP-DEV] PS(invalid_session_id) ?

2015-02-03 Thread Rasmus Lerdorf
Hey Yasuo, I noticed that you removed the invalid_session_id boolean from php_session.h. For extensions that do: PS(invalid_session_id) = 1; what is the new way for them? -Rasmus signature.asc Description: OpenPGP digital signature

Re: [PHP-DEV] [VOTE] Add is_cacheable() stream-wrapper operation

2015-02-02 Thread Rasmus Lerdorf
On 02/02/2015 08:38 AM, François Laupretre wrote: > Hi, > > Opening the vote for : > > https://wiki.php.net/rfc/streams-is-cacheable > > This RFC proposes a generic way for opcode caches to decide if a given URI > is cacheable or not. Doesn't this imply that "path" is the one true cache key? Th

Re: [PHP-DEV] [RFC] Fix "foreach" behavior

2015-01-31 Thread Rasmus Lerdorf
On 01/30/2015 09:10 PM, Dmitry Stogov wrote: > Hi, > > Nikita got an idea about stopping changing of array/object internal > pointers even in forech by reference. > I've added an additional RFC section: > > https://wiki.php.net/rfc/php7_foreach#additional_behavoir_change > > Trivial implementati

Re: [PHP-DEV] Magic getter bug tickled by Moodle

2015-01-30 Thread Rasmus Lerdorf
On 01/30/2015 11:13 PM, Michael Wallner wrote: > > On 31 Jan 2015 06:04, "Rasmus Lerdorf" <mailto:ras...@lerdorf.com>> wrote: >> >> There is something weird going on with PHP7 and the moodle_page class >> and all its magic methods. It dies with

[PHP-DEV] Magic getter bug tickled by Moodle

2015-01-30 Thread Rasmus Lerdorf
There is something weird going on with PHP7 and the moodle_page class and all its magic methods. It dies with a: /var/www/moodle/blocks/navigation/block_navigation.php(223) : Notice - Undefined property: moodle_page::$navigation /var/www/moodle/blocks/navigation/block_navigation.php(223) : Fatal e

Re: [PHP-DEV] php7dev Vagrant box

2015-01-30 Thread Rasmus Lerdorf
On 01/30/2015 05:06 AM, Rasmus Lerdorf wrote: > On 01/30/2015 02:17 AM, Ralf Becker wrote: >> Tried installing EGroupware (www.egroupware.org) on your vagrant box. >> >> Unfortunately our installation check, checking for various requirements, >> immediately tr

Re: [PHP-DEV] php7dev Vagrant box

2015-01-30 Thread Rasmus Lerdorf
On 01/30/2015 02:17 AM, Ralf Becker wrote: > Tried installing EGroupware (www.egroupware.org) on your vagrant box. > > Unfortunately our installation check, checking for various requirements, > immediately triggers a segmentation fault :-( > > ==> /var/log/nginx/php-fpm_error.log <== > [30-Jan-20

Re: [PHP-DEV] Use of {} with member.

2015-01-29 Thread Rasmus Lerdorf
On 01/29/2015 01:32 PM, Yasuo Ohgaki wrote: > Hi all, > > I came across with bug #68947 https://bugs.php.net/bug.php?id=68947 > and realized small inconsistency. > > http://3v4l.org/ldZKl > > $obj->${array[$key]}; // Syntax error > $obj->{$array[$key]}; // Works > > $obj->${key}; // E_NOTICE. D

[PHP-DEV] php7dev Vagrant box

2015-01-28 Thread Rasmus Lerdorf
As a follow-up to my PHP7 Homework post last week, here is a bit of spoon-feeding for all you lurkers on this list. https://atlas.hashicorp.com/rasmus/boxes/php7dev The description there should be fairly self-explanatory. If you have a computer running Linux, OSX or Windows and about 4G of disk s

Re: [PHP-DEV] Improvements to for-each implementation

2015-01-27 Thread Rasmus Lerdorf
On 01/27/2015 08:55 AM, Dmitry Stogov wrote: > The patch makes ~1% improvement on Wordpress-3.6 (saving duplication and > destruction of 200 arrays on each request) Awesome! signature.asc Description: OpenPGP digital signature

Re: [PHP-DEV] Dort behaviour change on php7 master

2015-01-26 Thread Rasmus Lerdorf
On 01/26/2015 11:14 AM, Pascal Chevrel wrote: > Hi all, > > I just compiled master to test my main application and the good news is > that I have no functional regression and some of the views get a > considerable speed up (like, page generation divided by two!). > > I had one unit test failing a

Re: [PHP-DEV] PHP7 Homework for everyone reading this list

2015-01-22 Thread Rasmus Lerdorf
On 01/22/2015 02:30 PM, Dan Ackroyd wrote: > On 22 January 2015 at 21:07, Lester Caine wrote: >> imagick is now available? > > Not yet. I'll try to finish it off before the end of the weekend. Most > of the work was done earlier, but I need to add the changes for the > Native TLS. > > btw this r

[PHP-DEV] PHP7 Homework for everyone reading this list

2015-01-22 Thread Rasmus Lerdorf
By installing a couple of apps (Wordpress-4.1, Drupal8 and Moodle - there are still some issues in Moodle I haven't figured out yet) on a box we've tracked down some bugs over the last couple of days. It would be really useful if we got more eyes on this. Install php7, then install any random app a

Re: [PHP-DEV] Re: Help - gcc mystery in ext/imap

2015-01-20 Thread Rasmus Lerdorf
On 01/20/2015 02:46 PM, Stanislav Malyshev wrote: > Hi! > >> So, I guess the lesson is that we need to be careful when we migrate >> extensions to PHP 7. Passing ints instead of size_t string length params >> to zpp can cause extreme weirdness and we should go through all our >> bundled extensions

[PHP-DEV] Re: Help - gcc mystery in ext/imap

2015-01-20 Thread Rasmus Lerdorf
On 01/20/2015 01:54 PM, Rasmus Lerdorf wrote: > Things I have tried. changed it from "p" to "s" and also from "p" to "S" > and using a zend_string * instead. In both cases I got the same bogus > address back from zpp. Right now I am trying to make s

[PHP-DEV] Help - gcc mystery in ext/imap

2015-01-20 Thread Rasmus Lerdorf
In testing PHP7 beyond just the default extensions, I am noticing that ext/imap is segfaulting on almost every test. I tracked it down to this code in ext/imap/php_imap.c: /* {{{ imap_do_open */ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) { char *mailbox, *u

Re: [PHP-DEV] [PHP-CVS] com php-src: Faster sorting algo: UPGRADING Zend/Makefile.am Zend/tests/methods-on-non-objects-usort.phpt Zend/zend_API.c Zend/zend_hash.c Zend/zend_hash.h Zend/zend_ini.c Zend

2015-01-18 Thread Rasmus Lerdorf
On 01/18/2015 09:00 PM, Andrea Faulds wrote: > That would also mean a future sorting API could unify user sorts and non-user > sorts: just make the default callback be cmp(). > > Usage would be like this: > > cmp(1, 2); // 1 > cmp(1, 1); // 0 > cmp(2, 1); // 1 > > Essentially, exactly like the

Re: [PHP-DEV] [PHP-CVS] com php-src: Faster sorting algo: UPGRADING Zend/Makefile.am Zend/tests/methods-on-non-objects-usort.phpt Zend/zend_API.c Zend/zend_hash.c Zend/zend_hash.h Zend/zend_ini.c Zend

2015-01-18 Thread Rasmus Lerdorf
On 01/18/2015 02:08 PM, Rasmus Lerdorf wrote: > We have to be really really careful with this "oh, that code is wrong, > so we can break it argument". This will break hundreds if not thousands > of sites in a hard-to-debug way. It took me less than a minute of > looking on

Re: [PHP-DEV] [PHP-CVS] com php-src: Faster sorting algo: UPGRADING Zend/Makefile.am Zend/tests/methods-on-non-objects-usort.phpt Zend/zend_API.c Zend/zend_hash.c Zend/zend_hash.h Zend/zend_ini.c Zend

2015-01-18 Thread Rasmus Lerdorf
On 01/18/2015 11:45 AM, Stanislav Malyshev wrote: > Hi! > >> Yes, like I said, I am aware that the comparison function is flaky >> but it is still code that has worked for 15 years so we have to be >> clear about the BC break. The fact that it works up until the array > > Looking at that function

Re: [PHP-DEV] [RFC] Skipping parameters take 2

2015-01-17 Thread Rasmus Lerdorf
On Jan 17, 2015, at 17:52, Marcio Almada wrote: >> Cryptic notation is not a PHP way. IMHO.I like original "default" proposal >> and it is good enough. >> Regards, > > When I suggested `_` it was more as a feature wandering. I like > `default` too. The RFC looks good enough as it is now :) _ i

Re: [PHP-DEV] [PHP-CVS] com php-src: Faster sorting algo: UPGRADING Zend/Makefile.am Zend/tests/methods-on-non-objects-usort.phpt Zend/zend_API.c Zend/zend_hash.c Zend/zend_hash.h Zend/zend_ini.c Zend

2015-01-16 Thread Rasmus Lerdorf
On Jan 16, 2015, at 19:18, Xinchen Hui wrote: > > Hey: > > >> On Sat, Jan 17, 2015 at 8:20 AM, Rasmus Lerdorf wrote: >>> On 01/16/2015 03:54 PM, Simon J Welsh wrote: >>> That’s an invalid comparison function. It causes the current usort to >>> rev

Re: [PHP-DEV] [PHP-CVS] com php-src: Faster sorting algo: UPGRADING Zend/Makefile.am Zend/tests/methods-on-non-objects-usort.phpt Zend/zend_API.c Zend/zend_hash.c Zend/zend_hash.h Zend/zend_ini.c Zend

2015-01-16 Thread Rasmus Lerdorf
On 01/16/2015 03:54 PM, Simon J Welsh wrote: > That’s an invalid comparison function. It causes the current usort to reverse > sort the array and I see no problem with that changing (you’re saying that a > value for $a less than $b is in fact greater than it, and a value of $b less > than or equ

[PHP-DEV] Re: [PHP-CVS] com php-src: Faster sorting algo: UPGRADING Zend/Makefile.am Zend/tests/methods-on-non-objects-usort.phpt Zend/zend_API.c Zend/zend_hash.c Zend/zend_hash.h Zend/zend_ini.c Zend

2015-01-16 Thread Rasmus Lerdorf
I think this broke usort() of more than 16 elements. eg. 'aaa', 'date' => 'Oct 8, 2006' ], [ 'id' => 'bbb', 'date' => 'Nov 14, 2008'], [ 'id' => 'ccc', 'date' => 'Dec 19, 2014'], [ 'id' => 'ddd', 'date' => 'Feb 4, 2010'], [ 'id' => 'eee', 'date' => 'Jul 7, 2013'],

Re: [PHP-DEV] Top 10 Pecl extensions PHP7 compatibility

2015-01-15 Thread Rasmus Lerdorf
On 01/14/2015 06:05 PM, Dan Ackroyd wrote: > On 14 January 2015 at 21:21, Michael Wallner wrote: >> * imagick > > Most of the work was done while it was still called NG: > https://github.com/danack/imagick/tree/phpng . Which means that branch > probably won't work against master as there have bee

Re: [PHP-DEV] Top 10 Pecl extensions PHP7 compatibility

2015-01-14 Thread Rasmus Lerdorf
On 01/14/2015 07:24 PM, Xinchen Hui wrote: > On Thu, Jan 15, 2015 at 1:53 AM, Julien Pauli wrote: >> I obviously will help porting some of them. > as I remembered, memcached and redis already be proted by demon at php.net For memcached, do you mean this pull request? https://github.com/php-memc

Re: [PHP-DEV] rand(), mt_rand() and limits

2015-01-12 Thread Rasmus Lerdorf
On 01/12/2015 01:31 AM, Andrea Faulds wrote: > Hi Rasmus, > >> On 12 Jan 2015, at 09:06, Rasmus Lerdorf wrote: >> >> Yes, there is plenty of code out there that relies on srand()+rand() >> returning a repeatable sequence of pseudo-random numbers. I have written &

Re: [PHP-DEV] rand(), mt_rand() and limits

2015-01-12 Thread Rasmus Lerdorf
On 01/11/2015 06:05 PM, Stanislav Malyshev wrote: > Hi! > >> Also, FWIW, anyone who used the Suhosin patch couldn’t use srand() >> because it disabled it. > > And? You can disable any function in PHP, that doesn't mean anything. > >> Because if we don’t break it, people will continue to rely on

Re: [PHP-DEV] function overloading

2014-12-03 Thread Rasmus Lerdorf
On 12/03/2014 01:40 PM, Robert Stoll wrote: > Heya, > > > > I would like to know If it is somehow possible to overload existing functions > by extensions. And if it is possible, are > there already some extension doing it? > > I am not talking about the magic __call function. I am talking ab

Re: [PHP-DEV] Fwd: [php-src] Constant-Time bin2hex() implementation (#909)

2014-11-26 Thread Rasmus Lerdorf
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/26/2014 11:45 AM, Anthony Ferrara wrote: >> That seems like a lot of functions to artificially slow down. > > Well, in most cases it shouldn't slow it down by a non-trivial > margin. If that can be shown definitively, then I would have fewer ob

Re: [PHP-DEV] Fwd: [php-src] Constant-Time bin2hex() implementation (#909)

2014-11-26 Thread Rasmus Lerdorf
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/26/2014 07:29 AM, Scott Arciszewski wrote: > http://events.ccc.de/congress/2012/Fahrplan/attachments/2235_29c3-schinzel.pdf > > No, a random delay is not sufficient. Sure, I mentioned that if the scenario allows for lots of observations then it

Re: [PHP-DEV] Fwd: [php-src] Constant-Time bin2hex() implementation (#909)

2014-11-26 Thread Rasmus Lerdorf
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/25/2014 07:37 AM, Scott Arciszewski wrote: > I would like to, at the minimum, suggest making the following > functions run in constant time: > > * bin2hex() * hex2bin() * base64_encode() * base64_decode() * > mcrypt_encrypt() -- requires delving

Re: [PHP-DEV] Re: [PHP-CVS] com php-src: Partial fix for bug #68365 (zend_mm_heap corrupted after memory overflow in zend_hash_copy): Zend/zend_variables.c

2014-11-07 Thread Rasmus Lerdorf
On 11/07/2014 06:52 AM, Ferenc Kovacs wrote: > 5.4 is in security fix mode, let see what Stas thinks about this. I am not that concerned about 5.4. People should be upgrading. But we should get this into the next 5.5 and 5.6 releases. -Rasmus -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] Re: [PHP-CVS] com php-src: Partial fix for bug #68365 (zend_mm_heap corrupted after memory overflow in zend_hash_copy): Zend/zend_variables.c

2014-11-07 Thread Rasmus Lerdorf
> On Nov 7, 2014, at 00:38, Remi Collet wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Le 07/11/2014 07:46, Dmitry Stogov a écrit : >> Commit:9dfa843a386b65b18353c510f032e322004d0bb7 Author: >> Dmitry Stogov Fri, 7 Nov 2014 09:46:49 >> +0300 Parents: 0ddcf2a919a24c

<    1   2   3   4   5   6   7   8   9   10   >