PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Mar 1, 2020 22:14
@DaveRandom I can do it by myself if needed, but online editor is more comfortable for me.
Mar 1, 2020 22:10
@DaveRandom Usually when open first page. Time to time first page loads, but login is breaks with time out
Mar 1, 2020 21:48
Hi! Who support edit.php.net? It does not work past two weeks. Always ERR_TIMED_OUT.
Feb 7, 2020 22:53
@Sherif Okay, not 6, but 19. And that it changes?
Feb 7, 2020 22:49
"Internals" part of docs in terrible condition, that I want to say
Feb 7, 2020 22:48
@Sherif I'm about that I really update this page (maybe I last who do it, no matters)
Feb 7, 2020 22:46
@Sherif Yes, I'm changed work last year and little lost in time :) You can check by commit history
Feb 7, 2020 22:40
> The OpCodes haven't changed much.
It changes. 6 months ago I'm updated opcode's page with dozen of new entries.
And worst is that they not only added, but removed too. Opcode added in one commit and removed in next for example - it's common case.

Also, description of `ext` value of opcodes is absolutely obscure at all.
Feb 1, 2020 09:53
Hello there.
socket_wsaprotocol_info_export and corresponding functions available only in win32 builds, I right?
Jul 12, 2019 13:13
Hello there!
Looks like "deprecate curly braces array access" RFC is going to pass.
So I have question about provided in patch migration script. How I shall do: left it in patch, or move it to gist and make link in patch description?
Jul 5, 2019 23:10
By the way, 'type handler' may be used not only for primitives. It opens interesting perspective to realize traits usage like extension functions in Kotlin/C#/ect.

register_type_handler("SomeClass", "MyTraitClass");
Jul 5, 2019 22:55
@PeeHaa sic! Idea appeared after reading rfc "Add str_starts_withs(), str_ends_with() and related functions". I suggest that those functions is helpful, but I think that adding another 4(8) old-style function into standard library is wrong way. It is vicious circle.
Jul 5, 2019 22:39
then execute associated function.
"aaa"->uppercase()
cast as
(new string("aaa"))->uppercase();
Jul 5, 2019 22:37
Another crazy idea. (sure that I'm not first)
Declare internal (pseudo)classes for all primitive types. If primitive followed by `->` suffix
Mar 25, 2019 14:26
@Danack wait a minute. I writen this rfc after positive feedback about suggestion for remove "alternate access syntax" there in chat. By you words it is best that anybody can do - it is not do anything, becouse it may produce "drama in discussion"?
Mar 25, 2019 14:01
@Danack That's why discussion is needed, isn't it? :)
Mar 25, 2019 10:39
I think that you do not understand "reusing" argument because I'm cant clear describe that I'm mean. I will try one more time :)
I mean not reusing one-to-one, but other features with curly braces syntax (lambdas for example) that in some cases may provide ambiguity on parsing phase or(!!!) for human understanding.
Lets imagine. "$a = {'first', 'second'};" - this is incorrect creating of array or, I don't know, "struct" definition? I know that it is incorrect syntax for now, but if we keep curly braces syntax for arrays then it can confusing programmer.
Mar 25, 2019 09:56
@JoeWatkins Okay, I understand you. I do not fully agree, but I respect your opinion.
Mar 25, 2019 09:45
@JoeWatkins "Not on my shift"? :) I think that in far, far future it will be possible, why not? But this is only potential opportunity, not call to action.
Mar 25, 2019 09:35
@salathe Maybe it is good to separate "arguments for deprecate/remove" and "arguments why it is almost safe to deprecate/remove"
Mar 25, 2019 09:21
I think that actually we can. But not in nearest releases. Maybee in 8.3 or later.
Personally, I think about window access (like slices in Go).
Mar 25, 2019 08:53
Good day!
I want to start voting tomorrow. Do you have any "last minute" suggestions?
https://wiki.php.net/rfc/deprecate_curly_braces_array_access
Mar 24, 2019 08:16
Hi!
`This function was
<emphasis>DEPRECATED</emphasis> in PHP 7.4.0, and <emphasis>REMOVED</emphasis> as of PHP 7.4.0.`
What a twist!
Mar 19, 2019 10:44
@tereško if I check (ce->ce_flags & (~0)) in class_exists function it may provide false negative for any class?
Mar 19, 2019 10:24
It is valid situation for class if ce->ce_flags == 0?
Mar 19, 2019 06:41
@rtheunissen I didn't quite understand you correctly. Thought you were offering something like LinkedList
Mar 19, 2019 06:39
@rtheunissen You mean "deleting last Bucket"? For this case you right.
Mar 19, 2019 06:24
@rtheunissen One more int field in Bucket and more complex packing. Also I think that it does not provide any performance. Check to IS_UNDEF vs resolve offset.
Mar 18, 2019 13:23
depends of documentstion.
Main concept there is "type with receiver". Idea is that any type can apply to yourself received result. So declare behavior for arrays if them "receive" int/string then use it as key.
Mar 18, 2019 12:28
I have a crazy idea how to keep curly braces access syntax for strings and array and same time implements inline lambdas with receiver.
Actually it will be extacly lambda those returns value to it's receiver and in case of array/string will be interpreted as key if applied to string/array and if is an int or string.

$a{10} => $a{return 10;} => if $a is string or array then point to $a[10]

Just as concept for thinking about
Mar 18, 2019 10:52
Hello there!
It will be useful to refactor zend_builtin_functions from zend_parse_parameters usage to ZEND_PARSE_PARAMETERS_START...?
Mar 16, 2019 19:06
@Jeeves Hm... Very strange. Russian docs has same version with english, but this "note" does not match. But I can't remember this correction in "changed files"... I will recheck tomorrow.
Mar 16, 2019 18:58
In docs "When overriding a parent method, the child's method must match any return type declaration on the parent. If the parent doesn't define a return type, then the child method may do so."
Bug description - "It is not right for now"
https://secure.php.net/manual/en/functions.returning-values.php
Mar 15, 2019 15:19
what about magic var?
$x = {$_ * $_};
$x(10); //100
[1,2,3]{$_[0] + $_[1]} //3
$somevar = 10; $somevar{$_ * $_} //100
Mar 15, 2019 13:51
@m6w6 and I think it will be common error. If we do not deprecate curly braces array access :D
Mar 15, 2019 13:48
returns 0
Mar 15, 2019 13:48
@m6w6 $x = "0"; echo ($x){$x*$x}; is valid syntax for now
Mar 15, 2019 13:31
Hi.
Add migration script in https://wiki.php.net/rfc/deprecate_curly_braces_array_access
Mar 13, 2019 12:17
@NikiC Correct if i'm wrong. It is all cases where no ';' or '}' before '}'?
Mar 13, 2019 11:55
@PeeHaa legacy is legacy, nowadays is nowadays. Who knows what may rise from abyss of ages.
Mar 13, 2019 11:43
@PeeHaa Potentially it may provide heavily impact to large legacy projects. Slow growth will give more time to prepare migration. But maybe I'm too cautious.
Mar 13, 2019 11:27
@NikiC inside zend_compile.h or somwhere else?
Mar 13, 2019 11:20
@PeeHaa Thanks. Unfortunately I'm not good in english :( But I'm work on it :)
Also 2: I'm do not know if 7.5-7.6-... is in roadmap. So if yes, then 7.5 - warning, 7.6 - error etc. If not, then 8.0 - warning etc.
Mar 13, 2019 11:05
Wrote “Reasons not to use the curly braces syntax:” and changed the implementation.
https://wiki.php.net/rfc/deprecate_curly_braces_array_access
Mar 12, 2019 16:18
@NikiC Exactly! Thanks! :)
Mar 12, 2019 16:13
@NikiC I do not see simple way to do this check on compilation phase because actually the same ast node is creating. Need to thinking about.
Mar 12, 2019 16:09
@NikiC I do not understand how to show E_DEPRECATED on ast creating phase. Looks like it silently dropped. But maybe I'm wrong.
Mar 12, 2019 16:06
@pmmaga ok, do it tommorow. Today is completely at the mercy of the family :)
Mar 12, 2019 12:09
@NikiC as an idea for thinking about. May be add functionality to GC for repack arrays with holes.