« first day (3550 days earlier)      last day (1380 days later) » 

12:19 AM
Speed degradation with many NOTICEs and set_error_handler ・ Performance problem ・ #79794
 
 
2 hours later…
2:13 AM
Windows SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE ・ Filesystem function related ・ #79795
 
 
2 hours later…
4:28 AM
LaraArret ・ *General Issues ・ #79796
 
 
2 hours later…
6:44 AM
Any guidance into how to implement throwing error on $foo = exit();? I think I went too far up to zend_emit_assign_znode and should look earlier but am not sure if that's even possible that way
I think it's too complex and ambiguous to allow false or exit; and forbid $foo = exit;
IMO both are dumb statements
But I know we used to do or die() in combination with mysql_connect()
function foo(): void {}
var_dump(0 or foo());
Above gives bool(false) :P
No matter of strict_types
 
„0 or NULL“ is false or not?
 
yes it's false, but void function doesn't return NULL right?
 
What else? Nothing is null in php
 
Oh no sorry it returns NULL
Yes, yes my bad
I think it's not possible to forbid $foo = exit; since false or exit; is allowed
Or at least I don't know how to do it
But the good thing is I got declare strict_types = 1, ticks = 1, encoding = 'UTF-8'; and __halt_compiler; working
 
7:15 AM
Probably it would be nice to convert assert into statement in a future, cause it's not a function but it looks like it is
assert true == false or new CustomError('True is not false!');
 
7:36 AM
Done, reduced RFC to declare and halt compiler, implemented both, rephrased use of language constructs and added statement|expression phrases for clear understanding.
 
@IluTov The "dynamic labels" section
Normally I'd be jX =>label as part of a jump instruction, here it's .aword =>label as part of jumptable data.
 
'assert' top_statement T_ELSE expr ';'
Wouldn't it make more sense to have assertions look like statement as well?
assert { $foo === 'bar; $bar === 'baz'; } else throw new Exception('Fail');
It does no longer look like an expression
This form could be introduced as an optional alternative allowing to use blocks of statements
Any thoughts?
 
8:33 AM
its fun running JIT code under a callgraph profiler to see whats not getting through zend_execute_ex anymore, but timings are not at all comparable anymore on a function level as the observing itself causes so much distortion
 
9:09 AM
using a computation heavy doctrine hydration with the JIT trigger mode 5 it looks like its ~5% faster than with just opcache. the jit triggers 0 and 3 make it 5% slower
computation heavy as in, you would rarely do that in real life, hydrating 2000 entities.
 
9:55 AM
i do understand correclty that JIT works on the script level? If you have trigger 4 (docblocks) and a single function says @jit then it jits the whole script?
ah no, in that case it only jits the one op_array
the fun thing is, when you run the same script with just 100 instead of 2000 entities, then unjitted is faster
 
10:20 AM
@NikiC So .aword is an (undocumented) directive then? What does it do? I don't understand the documentation. For .dword it says "This data directive emits one or more unsigned 32-bit values", emit where? There is no .qword directive which possibly could've been used for 64 bit.
I'm asking because the jump table is currently skipped on 64 bit machines (because of the comment above (TODO: DynASM stores .aword as 4-bytes even in 64-bit mode ???). Since match skips the CASE_STRICT chain when a jump table is generated it won't work without that instruction.
Sorry, I'm new to this, those might be stupid questions.
 
@IluTov dword is 4 bytes, aword is 4 or 8 bytes depending on x86 or x64. Presumably from "address word"
As to where it is emitted: Where you put it. It's just raw data emitted into the instruction stream, basically
And what the comment refers to is presumably a dynasm but where it stores .aword as 4 bytes even on x64
 
10:59 AM
@NikiC Ok. I was hoping to replace the .aword instructions with .dword/.qword depending on the architecture. Apparently .qword can be defined in the list here which allowed me to replace the .awords with .qword but it still segfaults.
It's quite hard (to me) to find the assembly instruction in the .dasc file that fails. Anyway, I'll just keep looking.
 
@IluTov looking at the op_data implementation, it doesn't do anything with the sz for labels
 
11:16 AM
@NikiC I don't fully understand it but when I add an entry for qword the errors go away. Without I get "error: unknown statement `.qword'"
 
12:12 PM
Should declare statement be allowed only in top level statements just like const is or it should keep the same semantics as declare stmt which allows ticks directive to be declared conditionally?
Const are top level stmts which cannot be used conditionally, the define expression can.
 
12:24 PM
Will ticks even work with JIT'ed code?
 
12:41 PM
@NikiC good news, Remi doesn't care, he even would like to drop mysqlclientlib
 
1:29 PM
Maybe a compiler halt shouldn't even be a statement but rather special end tag IMHO that makes more sense
 
2:11 PM
@beberlei any particular reason php-rfc-watch still shows make_ctor_ret_void RFC in voting phase?
 
@moliata no :) seems like bug
 
ah, okay
I'm ready to make a PR for typed class constants, the only problem right now are those shift/reduce conflicts.
can't get rid of them when using optional_type_without_static
 
2:34 PM
@brzuchal Such a special end tag exists already: php.net/halt_compiler
 
How about we make ?> the normal closing tag and php?> the halt compiler closing tag.
Please keep in mind that I wrote php backwards in there :P
 
3:08 PM
😂
 
Preprocessor Hypertext: PHP
 
@NikiC Do we have to wait for the vote on your namespaced names as token RFC before the shorter attribute syntax can be merged? I think it would be nice to get more testing in the upcoming alphas to make sure there aren't any other issues.
 
There is no more simple way to skip notices like list($foo, $bar, $baz) = explode(",", $in) + array_fill(null, 0, 3); right?
 
i tried pushing using a git http link
`git push https://github.com/fish/fish_project.git`
i got an error of access denied
remote: Permission to fish/fish_project.git denied to StrangeName.

i am confused due to the StrangeName not being mine was expecting `bobbyaxe`
checked my git config everything seems okay
 
maybe there should be a syntax [$a, $b => 2, $c => 3] = [10, 11]; which assigns $a = 10; $b = 11; $c = 3;?
good idea or bullshit? :-D
effectively desugaring to $a = $rval[0]; $b = $rval[1] ?? 2; $c = $rval[2] ?? 3;
but unsure about the null case when any value of $rval is null.
 
3:27 PM
any ideas any one ?
 
@BobbyAxe fish/fish_project - is that your redacting or the real name?
 
nope not the real link
just an example
 
I've had trouble before, it ended up being I had something wrong in the command
 
it was so strange
used the ssh link though it worked
it is just nagging at me like why the strange name
it is a collaborated project but the name is not a collaborator on the project or any thing like that
 
@TheodoreBrown there is nothing to test
and no, no merge for sure
 
3:49 PM
any idea why I'm getting this make error in an Ubuntu VM? ext/pcre/pcre2lib/sljit/sljitConfigInternal.h:219:2: error: #error "-mshstk is needed to compile with -fcf-protection"
hm, I think a fresh ./buildconf has sorted it ¯_(ツ)_/¯
 
cmb
4:15 PM
@IMSoP yep, that's about recently introduced changes to ext/pcre/config0.m4 (needed for PCRE2 10.35)
 
4:31 PM
@NikiC you mean seriously, right? Cause I like it. We no longer need a halt compiler statement nor espression then
 
@bwoebi I think I saw a proposal for [$a = x] = at some point
 
@NikiC can't remember such a proposal - do you like it though?
 
@bwoebi no -- but more in the sense that list() in general seems like a bit of a dead end. Too many issues.
 
4:59 PM
@NikiC academically it has many issues, but practically it is good enough for a lot of cases
 
5:31 PM
@bwoebi also true
 
@NikiC can you review #5812 PR and merge it?
 
6:00 PM
I know it is easy to laugh of proposal which doesn't hin much real value. I try to address more consistency and separate statements from expressions. I've proposed halt compiler to be a statement cause it looks like a function but Never can be used like that.
As a statement it also make not much sense but since there is no special tag which forces parser to stop this is the only way to do that
I was thinking also about %halt tag, @?> closing tag telling to ignore/suppress anything behind it or %?> as a closing tag
 
@brzuchal I think the main problem is not that __halt_compiler wouldn't make more sense having no parens but that it introduces an alternative syntax for something that is extremely rare.
 
We do have many constructs which are expressions so I wanted to at least try to get rid of one or two
@IluTov I am not arguing with that. But it may have much more sense for newbies
 
Similarly, maybe a declare with no parens would've been better (I don't have an opinion on this one) but the parens are good enough for me not to want to introduce another alternative syntax.
 
So they don't need to figure out why an expressions stops parsing.
 
@brzuchal I didn't come across __halt_compiler until I've known PHP for ~7 years :)
I don't think most people will ever have to care about it.
> I know it is easy to laugh of proposal which doesn't hin much real value.
I do agree with this one. Small contributions are very valuable. But not everybody will agree whether they are worth it. If they don't, don't take it personally :)
 
6:11 PM
There are more expressions like statements I'd like to open discussion in future like for instance assert() it is an expression but rather should be a statement cause it's not natural that expression argument ast doesn't execute and IMHO as a statement could be more clear of why it happens
IIRC unset is a similar that it is expression but probably should be a statement.
I'd like to change it till for eg PHP 9.0 with a small steps for each minor version of 8.x
 
@brzuchal The syntax for assert is extremely standardized across all programming languages so I strongly feel we should keep this consistent.
 
And then have a clean disambiguation between expressions and statements
 
You'll probably get similar responses for most of these. Alternative syntax should have a strong reason to be added.
 
Regarding the assert I'll take a look closer and if other languages also don't execute ast before making assertion then fine but if they don't then it's not like other languages, right?
assert conn != null : "Connection is null";
Abowe is Java assertion for instance
 
@brzuchal What do you mean by not execute the ast? I think pretty much all languages will parse assert and conditionally execute / compile the assertion depending on whether production settings are enabled.
 
6:26 PM
Rust has assert!() macro so it differs from expresaions
In js there is only console assert or debug don't remember now which AFAIK doesn't stop execution of ast and works similar to php assert as we know from 5.x
@IluTov as you can see for rust and Java these are not expressions so it's more intuitive to grasp that it won't execute anything.
While it differs for expressions cause they by nature first execute arguments list and compute their values before calling expression
That is not the case for statements.
IMO it makes more sense to have it as a statement then like in Java for instance cause we don't have macros like Rust and other languages which use macros for assertions.
It's not I don't like assertions but it's just I'd like to see a discussion about making language more predictable and more consistent
 
It's probably conditioning but Java looks weird to me.
 
@IluTov but you can see the point, don't you?
 
@brzuchal I don't know, just removing the parentheses won't make it more obvious to beginners that the argument isn't executed.
 
6:48 PM
for assertions in particular, it will be worth re-reading the discussion that led to its current form in PHP 7
I seem to remember at one stage there was a proposal that used a new keyword rather than retaining the existing function form
this is the RFC that we ended up with: wiki.php.net/rfc/expectations
 
7:04 PM
reading back, I can't find any mention of using a new keyword, but compatibility was an explicit design goal of the current implementation
 
@IMSoP does it make sense to propose an alternative syntax as a statement maybe similar to Java's in future and just open a discussion about it in a year time and then see what happens?
It's just I feel expressions should be left for function calls probably only
 
I was just pondering what it would look like in an ideal world; I though assert { some code here } would be logical, but it doesn't actually work
firstly, because the main argument to assert has to be a single expression, not a block
and secondly, because assert actually takes two arguments
 
Java houses : to divide assertion and message/exception throw part
*uses
 
is that consistent with any other part of the language, or just a weird special case?
 
Dunno but the only place with similar syntax is a case in switch statement
 
7:13 PM
it would be a bit awkward to propose the new syntax in the name of consistency, but have it not consistent with anything else
 
Having ast compiled and executed conditionally is also not consistent with expressions
 
sure, but the syntax doesn't tell you anything about that
 
Case in switch also runs what is after : if what is before fulfill the requirements
 
if it was part of introducing a new conditional compilation system (an idea which came up briefly in the 2013 discussion I was just skimming), it would make sense to have some new syntax for it
 
You're saying it doesn't make sense to discuss it again?
 
7:19 PM
I'm saying, like IluTov, I'm not convinced of the value of introducing an alternative syntax that just moves some punctuation
 
Well the aim of adding alternative syntax is to depreciate old one in a future and provide the new one in more intuitive manner.
 
right, but I can't think what would make it intuitive
 
For me more intuitive is an expression like a function if I can use its return value
If I can't which is the case it should look different
 
that's only the case because we don't have true void functions
 
It is also not possible to determine that in dynamic language like php in compile time
 
7:24 PM
the bigger problem in that respect, IMO, is keywords that don't require parentheses, but can be used in expressions, like require
 
I think it's not that you can use it more intuitively.....it's more that it has fewer surprises. But this is really a marginal gain....
 
So we'll probably never see them which means we need different solutions/approaches
 
I once tracked down a serious bug to someone writing if ( require($filename) && $something )
the parentheses around ($filename) aren't actually doing anything, so what runs is if ( require ($filename && $something) ), which is never going to do anything useful
 
Ok got it a precedence applies here differently cause parentheses are not taken into consideration
require $filename : $resultOfRequire;
 
or just make it a function
 
7:28 PM
Would it make sense?
 
for that matter, just make assert evaluate to null in an expression context as though it was a "void" function
in terms of intuition, thinking of it as a function with two arguments doesn't seem that far wrong
Rust's function/macro distinction is nice; maybe in an ideal world we'd have assert!(some expression), isset!($someVar), etc; but I'm not sure making the parentheses optional really achieves the same distinction
 
The ! Makes enough distinction from function
 
yeah, it says "there is magic happening here"
 
I was thinking of removing parentheses and : cause we don't have macros and it tells Clearly there's a magic
 
I don't think it does signal magic in the same way
especially if the message remains optional
 
7:39 PM
Fair but there's something suspicious at first look if it doesn't look like a function
 
but that's the wrong signal - when enabled, it does behave like a function
the fact it has no return value seems like an implementation detail that could be fixed
in fact, this whole time I didn't check, and it can in fact be used as an expression
it returns a bool
so without mandatory parentheses, it would have the same problem as require: assert(false) && die('???'); would be re-interpreted as assert( false && die('???') )
 
Not if it is a statement w/o parentheses
 
an expression can always have parentheses
if assert false is valid, so is assert(false) and assert(((((false)))))
I think a Rust-style "this function is magic" signifier is more useful - assert!($expression, $message), isset!($var), empty!($var)
 
Yes that's why I think assert and/or/maybe require should only be a statements
 
they all act like functions for the most part, but they have a bit of magic to them
 
7:54 PM
If assert won't be allowed in my idea
'assert' expr ';'
And
'assert' expr ':' expr ';'
Only as a statements
 
assert(false) && die('???'); matches that grammar; it just doesn't do what the author intended
because (false) && die('???') is a valid expression
 
I'd propose the same for require family functions
Maybe
 
I don't see why require should become less function-like rather than more
it doesn't actually do anything particularly magic with its arguments
 
Yes but you cannot mix statements with expressions so you won't be able to put & & after assert if it were a statement
 
the whole of (false) && die('???') is a single expression
it matches the expr part of your grammar
 
7:58 PM
How so?
 
it's just false && someFunctionCall()
 
I think I'm lost now
 
so, 'assert' expr ';' means you can write assert $x && $y; correct?
because $x && $y is an expression
 
No
Ahh yeah
Indeed
The fact that it's allowed as a function ruin the idea
 
no, what ruins the idea is the recursive parser rule expr: '(' expr ')'
 
8:05 PM
I agree macro could be better then for assert
 
so you can't ban parentheses
 
True, but what can we do?
Macro only for assert only doesn't sound good
 
isset and empty definitely fit the same category
 
Exit and die?
 
possibly; although they don't do anything unusual with their arguments, which is what sets the other three apart
 
8:10 PM
They never return
So there's magic
You cannot expect using it as a function in assignment for instance
 
well, you can write it, it just doesn't do anything useful
 
With $Foo = die!("fertig"); gives clear sign there's a magic
 
unset is definitely in there
 
For me it's all about lang being more predictable
So if it is written like a function it should be a function
 
I don't really get your definition there; it takes parameters, and can be used in expressions, so for most purposes it is a function
it just happens to have the side effect of stopping the script
the same is true of any user-defined function that calls it: function myDie() { die(); } $foo = myDie();
 
8:15 PM
Yes but the distinction between functions and macros is more clear and easier to grasp if the behavior is different
 
but what is different about die compared to myDie above?
Swift has the interesting concept of "the Never type", where you mark such functions with a return type of ! rather than void
 
It does not make sense to operate on its return value cause it never returns
 
the same is true of the user-defined myDie
I think "never returns" is an interesting property, but it doesn't require any macro-like magic
 
Indeed
 
the same is not true of isset - you can't write a userland function that treats its arguments the way isset does
like assert, it can only be implemented by compiler-level code
 
8:19 PM
So is set and unset and assert a macro and die with exit as with never return return type?
 
yeah, I think so
 
Ok anything else can be improved?
halt!;
 
that would make sense
 
Or quit or stop
But it'd no longer look like a function and gives clear distinction and sign that the compiler takes an action here
 
yeah; and it would set a convention for future features that needed similar compiler-level support
 
8:26 PM
Exactly, can we author it together?
 
looking through the manual, list() is kind of compiler-magic too, but is largely replaced by [] anyway, so probably not worth fiddling with
 
Declare?
It does influence compiler only
In all cases
 
yeah, it also has its own weird syntax
if we get named params, then declare!(strict_types: 1) would make some sense
 
Yeah but then it would make sense with named arguments possibly
declare!(strict_types: 1);
 
yep; then at least it would be part of some pattern of syntax, rather than just this weird language of its own
my only hesitation with ! specifically is the strong association to "not"
it might be confusing for if ( !isset($foo) ) and if ( isset!($foo) ) to mean opposite things
 
8:32 PM
assert!(false, throw: new AssertionException("false is false")) ;
Kinda weird with named arg here
 
I dunno, I think it's kind of nice
 
How about %?
 
assert!(false, message: "false is false");
 
Indeed that is nice
 
I'd love such macros in PHP.
ANd I think the ! suffix from rust is a great idea.
 
8:34 PM
I like it too
People can get used to it
 
as long as !important isn't added
 
@Tiffany but… how am I supposed to write my custom CSS DSL without?
 
@IMSoP can we write that RFC together for 8.1?
 
I wouldn't restrict macros to mere argument passing though
 
@bwoebi what do you mean? Example?
 
8:42 PM
Allow something like $db->query!(SELECT * FROM users WHERE id = $id) - basically defining a DSL which understands sql (in userland) and can parse the $id token and replace it by properly escaped content
 
that would be nice, but would it be possible without having its own parser rules?
 
@IMSoP the only restriction would be, "if in macro context all opened parens must have matching closing parens"
and have a special lexer state within
 
right; but that's more complex than the examples so far, which can all be modelled as receiving the AST for a single expression from the normal parser
 
@IMSoP yes. But I think, IF we allow macros, we should actually make them fully fledged
and not restricted by our parser
 
what does Rust do there?
 
8:47 PM
would also allow for nice context sensitive html templating in PHP for example
(with proper escaping)
there are a lot of possibilities opening then
 
at the very least, it feels like you'd want the ability to use the existing parser and just get the AST, rather than having to re-define "expression" every time
 
@IMSoP yes, I fully agree there should be an ast!() macro
 
another example before I duck out to do the washing up: a working replacement for debug_zval_dump which can observe refcounts without affecting them
 
@IMSoP not sure how you'd do that with macros
at least not without vm support
 
indeed, but it definitely fits with assert and isset in terms of the level it operates on
 
8:50 PM
@IMSoP assert does not need vm support though - and isset only for perf reasons
 
How old were you guys, when you started programing?
 
I thought isset could distinguish states that wouldn't otherwise be detectable, but I'm now struggling to think of any
 
@IMSoP ($a ?? null) !== null
 
yeah, that :/
(that actually makes my head hurt to look at)
 
call!($foo->bar, args: $arguments, this: $baz);
 
8:58 PM
if we didn't have ?? in the language, it would be necessary for macros to have access to an equivalent
in order to make an isset! macro
 
@SalOrozco ~10
 
Call method or a closure in property, make sense?
 
@Tiffany oh wow. How you get into it. Someone you know was a programmer. Family member?
 
similarly, I don't think unset!($foo) can be expressed in terms of the rest of the language
so if we wanted it to be possible to define a variant of it, we'd need extra things that a macro could do; and the things that debug_zval_dump needs to do would be similar
 
@SalOrozco my dad introduced me to computers when I was three, when I was ten, I loved animals and wanted to make a simple encyclopedia for animals... my dad handed me a Mac Programming for Dummies book
 
9:02 PM
@IMSoP it looks like it
compact!(); //??
Or vars!();
 
@Tiffany what kind of mac did you start on?. My first computer was a macintosh classic at the age of 14. Didn't really use it for programming. I would just mess around with it. Didn't know what anything did. Didn't start programming till my mid 20's.
 
@SalOrozco PowerMac 8500/150
OS 8 and 9
 
args!(); // as a replacement for func_get_* ??
And mauve get one by its name etc?
@IMSoP above two makes sense to you?
Both are returning values known only for the compiler
 
9:18 PM
@Tiffany 150 MHZ expensive computer
When it came out.
 
@SalOrozco my dad kept several Macs in a room, he was an engineer for Northrop at the time
 
@Tiffany yeah, I imagine that only pros had those computers. Provably a lot more today when adjusted for inflation. The Mid 90s interesting times. Wasn't it AOL days, yahoo chats.
 
yup
I used to play Warcraft 2 multiplayer, found people on AOL, lol
playing Warcraft 2 multiplayer was easier on Mac back then than PC, connecting, that is
 
9:43 PM
Dungeons and Dragons for me. They used to come in 3 1/2 inch floppy disk. Connecting online was overall tough, If you had a call on the phone line you would get disconnected. I have a lot of siblings so they would get calls from friends all the time lol It was hard staying connected.
 
I can't remember if we had two phone lines back then, probably did
 
@brzuchal yeah, those definitely feel macro-ish; and don't forget extract, which is the reverse of compact
 
Did you ever use icq
 
the question then is whether we can define those all in terms of an actual macro language
I need to get to bed shortly, but will think about it some more...
 
@IMSoP I'm in a bed already, so will ping you tomorrow then
 
9:56 PM
lol :)
 
https://chat.stackoverflow.com/transcript/message/49829820#49829820
for anyone who had same issue i did, it turns out its a macbook thing, it saves login details in keychain Access and turns out the strange name was that of a colleague who once singed in to github on my pc several months ago

the fix was to just delete the the credentials from the keychain access
 
Sleep tight
 
you too
 
 
2 hours later…
11:52 PM
I'm writing a script that will loop, create X amount of test users, and save their IDs to a file. I am using a progress bar to see the progress in the CLI output. At first it starts very fast, about 25 users per second. But, as it goes on, it starts running slower and slower. After 1000 users it's about 5 users per second.
I have tried saving the user_id's to the file every 100 users (adding it), clearing the $userIds array (setting it to null), and then running gc_collect_cycles() to try to make it faster, but that doesn't seem to do anything.
Does anyone have any idea on how I could get it to run faster?
 

« first day (3550 days earlier)      last day (1380 days later) »