« first day (3322 days earlier)      last day (1609 days later) » 
00:00 - 22:0022:00 - 00:00

Wes
12:00 AM
so yeah it does call rewind
 
3v4l.org/soIAG <-- but rewinding an active generator doesn't throw, it's a no-op
 
Wes
@DaveRandom ugh
i wonder why yield from even exists
clearly can be interpreted in a million ways
and foreach() yield; is not that hard to write
and it's really obvious what it does
 
does it pass through ->throw()?
 
okay, this is telling me a lesson .... .
 
Wes
@DaveRandom too late it's already on the list of the unnecessarily confusing things
 
12:13 AM
the thing that is does which foreach alone doesn't is propagate throw()/send()
which is useful for async yield abuse, at least
 
okay, I have to fix some things....
 
Wes
well, you can always wrap with try/catch, no?
 
@JoeWatkins The more I look at function call handlers the more confused I become >.< What actually sets up a symbol table? In a simple DO_UCALL, it looks like to me that one never gets set up...
 
yeh but it gets horrid quite quickly
if fact you can't even do a straight foreach any more, you have to be able to continue the loop if the inner generator handles the exception
 
Wes
so are arrays literals ever interned? maybe just constant arrays?
norewinditerator?
 
12:18 AM
no thanks, I've had too many today already
 
Wes
? :B
 
somewhat a pitty, I was under the impression I could benefit from it, e.g. partial for-each and then yield the rest.
 
@Wes read: I don't know what that was in response to so I made a stupid joke :-P
 
Wes
you have to be able to continue the loop if the inner generator handles the exception -> in that case you can use norewinditerator
 
oh i wasn't thinking right anyway
 
12:22 AM
was not trying with throw but a traversable: 3v4l.org/HQmQj
^ can continue the loop, but need to next() on the correct iterator otherwise duplicates.
 
Hello guys
I am building a website that uses an external api. The api page is available to me when am logged in into the site but doesn't open when am signed out. Please is there a way of bypassing this using php stream ? please any suggestion, contribution and help will be highly appreciated. AM STOCKED. Thanks
 
12:38 AM
@DaveRandom That's a bug, it should throw: 3v4l.org/3LfvJ#v7125
@Wes For Amp and recursion.
 
@kelunik 3v4l.org/RFVZ3 yield from must be special-cased not to call rewind() on a generator
which I guess sort of makes sense
 
Rewind on the outer generator should still throw. /cc @bwoebi
 
although foreach still calls it 3v4l.org/D8O5G
I guess it should be consistent, but it might also be intentional
 
> There's no point in being grown up if you can't be childish sometimes.
 
presumably there is a totally separate code path for yield from when the delegate is a generator in order to handle ->send()/->throw()
 
12:57 AM
@Wes yield from in a generator can turn any iterable into a Traversable.
And any Traversable can be turned into an iterator via IteratorIterator.
 
Wes
yield and yield from always returns Generator, which is an Iterator itself
 
only when the function around is called.
anyway way too late for me, I yield from tomorrow then.
gn8
 
 
1 hour later…
Wes
2:20 AM
thank god for amazon. i can now buy weird stuff without getting judged
just bought 10kg of walnuts, almonds, hazelnuts, pistachios
because diet
and peanuts.
 
2:32 AM
Hello
I have an unanswered question.
1
Q: Auto populated Text box values in php

Akshay M AI am trying to create a dynamic page based on user's input. Here is a piece of code that i am struck with. There, is a section in which I am trying to ask the user's their available house configurations, such as 1 BHK, 2BHK ... etc.. However, i have a code that is currently doing the job partial...

ANYBODY THERE?
 
2:47 AM
@AkshayMA No. You're hallucinating.
Besides, answers oft lead to more questions.
 
3:46 AM
@LeviMorrison I believe it might not be, the symbol table doesn't hold references either I dont think, only indirect into cv/tv area of the frame that attached the table, but I'm not exactly sure ..
@LeviMorrison there may not be one, we don't use the table
@Wes not by the engine, but opcache does make literal (const) arrays immutable where it can ... one example is the static symbols in every function, that hashtable is immutable (or interned) ...
 
Wes
4:04 AM
so if i have private $array = [... big array ]; it won't be shared across requests?
or maybe it will be shared across instances of that class
unless i modify the array of course
 
it will be shared
 
Wes
not actually interning but sort of
 
if the array can be made immutable (ie, if it contains only constant literal elements)
yeah, sort of, there will be one instance of it, unless written, when written it's copied out of shm and into request memory to make it writable
or actually in preparation for it being written, the property will be copied on write, but the immutable statics of a function will be copied out for write when a closure is created from a function, because statics have to be writable ...
 
Wes
sounds very complicated stuff
 
 
3 hours later…
6:50 AM
php string related function exists a type confusion vulnerability – #78840
 
7:05 AM
Unable to override a private function when called from parent class – #78841
 
Wes
@Jeeves some people are impossible lol
was it @pmmaga that explicitly went and fixed that?
 
7:46 AM
user image
7
 
8:00 AM
controvert to argue about; debate; discuss.
 
morning all
I was trying to add option to skip parens on unset() and need a help with reduce/shift in parser. What I have so far is a zend_language_parser.y.diff and the zend_language_parser.output
Any advice?
I have been trying with different ways but always finishing with at least one reduce/shift conflict
 
8:32 AM
morns
 
gut moaning
 
cmb
8:54 AM
@brzuchal, an unset_variable can be ( expr ), and that conflict can't be resolved.
 
9:21 AM
> overridden version of the private function
gaaaaahhhhh
:P
 
Wes
i actually was surprised that worked correctly :D
so i thought pmmaga bothered to fix it lol
but looks like it's been like that for a while
 
what I did back then was to make it possible to declare a function in the child class with the same name as the private parent one. that used to be an error
 
Wes
5.2?
 
hmmmm,, that's the weird part, it was on 5.6
did it only affect private in the child? I can't recall
 
Wes
lol
 
9:26 AM
ah, it was about compatible signatures: 3v4l.org/KeuU2
 
morning
 
Wes
aaaaaaah, yeah now i recall
mornings
engrish help:
[...] because duplicate instances, if any, are completely identical [...]
[...] because any duplicate instances are completely identical [...]
does the latter sound right?
 
hello
Is it possible to disable the type = number field from being manually entered by the keys, and only enable the increment arrows?
i was trying to use:
		var input = document.getElementById("quantidade");
		input.setAttribute("max",d);// set a max
		input.setAttribute("min",0); // set a min
but the max never set
 
10:27 AM
@cmb I think there is a little mess in the parser
 
cmb
no, no ;)
 
10:38 AM
whenever I wanna try something out in parser I fail cause of some shift/reduce errors
 
@Wes I'd use future tense to make it clearer "because any duplicate instances would be completely identical" or possibly even longer "because if any duplicate instances exist, then they will be completely identical".
Does anyone have a script to generate a stub PHP file for an extension handy?
 
I'd use different words altogether, it's jarring to read "duplicate ... completely identical" ...
 
@cmb is that because of variable being a part of expr ?
 
I think there is a thing like that in php-src, or maybe on the wiki, cc nikita or someone who has been working on stubs, maybe christoph knows what I'm on about ?
 
btw as my question possibly wasn't clear, I mean the class and function prototypes, so that code analysis knows about them...
 
cmb
10:47 AM
@Danack, for an existing extension this likely has to be done manually. Yesterday a PR for the skeleton has been submitted, which added a stub file for that.
 
oh I thought there was a script
 
cmb
nope; that's why it takes so long to create and review the stubs PRs
@brzuchal, variable -> callable_variable -> function_call -> callable_expr
 
@cmb it works for echo with echo_expr it accepts parens and allows without them, the only thing would be required to filter expr asts to limit them to variables which can be unset, is it good enough?
 
11:19 AM
o/
 
11:30 AM
Throwable ->getTrace() no longer returns "args" – #78842
 
cmb
12:10 PM
@brzuchal, yes, that might be good enough
 
@cmb trying to follow the rules from parser and as long as I try to understand it the more completely nonsense token it's able to parse
 
@DaveRandom I've been to enough conferences to know that this work well
 
dereferencable_scalar: can be for eg. empty array `[]`
dereferencable: is also above
callable_variable: can be dereferencable with posible expr in square brackets
callable_expr: is for eg callable_variable with argument_list
variable: can be above
unset_variable: can be above

Which all means you should be able to `unset([][]())` from parser perspective :/
 
12:29 PM
@brzuchal yeah, it's restricting it at compile time
which is good enough
@brzuchal What you are attempting is allowing unset $var;?
What's the benefit you see to allow this syntax?
 
@bwoebi I'd like the language construct which unset is to be more consistent with other statements which cannot be used in read context with a list of variables
 
@brzuchal this reminds me of wiki.php.net/rfc/unset_bool
 
Unset is not a function but it looks like a function, some other language constructs looks like a function but they can be used in read context - theevaluated result can be assigned to variable or used in boolean test, unset cannot
 
which just went the other way round and make it consistent with everything returning a value
 
Different behavior of is_dir function on 7.2 vs 7.3 – #78843
 
12:41 PM
@bwoebi Was there any feedback about this proposal?
 
@brzuchal a little yes, IIRC. you'll have to dig the archives, it's been too long (6 years)
 
I'd like to allow use of unset without parens, so at least there can be a recommendet way without parens to use
@bwoebi well what I wanna do doesn't change any behaviour only allows syntax without parens which doesn't hurt that much, right?
Next thing I would see is declare although I cannot imagine removing parens for declaring ticks yet
 
doesn't actually hurt but TBH ... I just don't know how to feel about introducing a new idiomatic way to do something working well and not triggering suprises
 
Without changing any behaviour I think what cannot be assigned|used in read context should not look like a function
 
I've never actually wondered about unset requiring parens (rather I wondered why echo does not).
 
12:45 PM
well for me it's consistent, cause it cannot be used in read context
print() -> available in read context
echo -> not available in read context
unset() -> not available in read context
declare() -> not available in read context
IMO removing parens makes language easier to understand and in consequence easier to learn
I mean removing them all the places where they look like a function but are language construct in non-read context
require|require_once|include|include_once -> available in read context and all can use parens cause they require an expr which can be in parens
@bwoebi what do you think?
 
@brzuchal print is also available without parens
@brzuchal I'm unsure
 
@bwoebi Yeah, T_PRINT expr :/
I cannot see anyone trying to work on language syntax consistency but they exist in language
I mean not recently
@bwoebi this is weird, I wasn't expecting that
 
@brzuchal :-D I always use print without parens
 
$var = print $_SERVER['PHP_SELF']; // no error
$var = echo $_SERVER['PHP_SELF']; // syntax error
@bwoebi is it not worth making it more consistent?
 
I don't know. I exactly know how it works now, so I'm absolutely comfortable with status quo - not sure whether it will change anything in the eyes of a newcomer though
 
12:59 PM
$var = print $_SERVER['PHP_SELF']; // ok
$var = echo $_SERVER['PHP_SELF']; // syntax error
$var = isset($_SERVER['PHP_SELF']); // ok
$var = empty($_SERVER['PHP_SELF']); // ok
$var = unset($_SERVER['PHP_SELF']); // syntax error
$var = declare(strict_types=1); // syntax error
More examples of statements which looks like a function calls but cannot be used in read context
$var = print($_SERVER['PHP_SELF']); // ok
echo $_SERVER['PHP_SELF']; // n/a in read context
$var = isset($_SERVER['PHP_SELF']); // ok
$var = empty($_SERVER['PHP_SELF']); // ok
unset $_SERVER['PHP_SELF']; // n/a in read context
declare strict_types=1; // n/a in read context
Those look for me easier to grasp that they cannot be used in read context
 
 
1 hour later…
2:23 PM
I just realized print() always returns 1, always meaning always
 
@JoeWatkins I need to rethink my approach, I guess.
 
> exit is a language construct and it can be called without parentheses if no status is passed.
The docs says exit(int $status):void but can be used in read context, like $var=exit; or $var=exit(1);
I understand calling $conn = mysql_connect() or exit(1); makes sense but when assigning to a variable doesn't make any sense
$var = __halt_compiler(); // syntax error
__halt_compiler(); // ok
Next weird syntax
Can we decide to provide some dialects and clean this mess up?
 
yes, AFAIK the return value of exit is never used, but it doesn't really hurt anyone.. it would be a massive BC break though :)
about halt compiler, I guess it can't be used right in the middle of an expression hence the need for a separate line
 
@pmmaga it doesn't require separate line, but requires of parentheses, looks like a function but doesn't work like a function cause it's a language construct instructing compiler to halt processing
 
I'm having the weirdest thing happening with Composer
 
2:36 PM
What I mean with all the above examples we got a plenty of language constructs which are used in read context or cannot be, sometimes with parentheses sometimes only without them and sometimes it's optional, even if statements looks like a function sometimes cannot be used as a function
 
ubuntu@***:/data/html$ sudo composer why nesbot/carbon
laravel/framework  v5.8.35  requires  nesbot/carbon (^1.26.3 || ^2.0)

ubuntu@***:/data/html$ sudo composer why laravel/framework
There is no installed package depending on "laravel/framework"
I have laravel/lumen required but not laravel/framework
 
it's ok, read carefully
 
Why would it tell me laravel/framework requires carbon if nothing required laravel/framework?
 
2:49 PM
the actual dependency seems to be lumen -> lumen-framework -> illuminate/support -> carbon. That doesn't explain why it lists laravel/framework. Maybe there is some weird replaces entry or so
 
That is very weird. We have a deployment after_install_tasks.sh that runs composer install --no-dev and for some reason it's not including Carbon (as well as a couple other things) in the autoload file
 
@Alesana it's required by something for tests, but then you're not requiring it yourself in your project's main composer.json file?
 
But if we ssh into the box afterwards and run the same command (composer install --no-dev) it says Nothing to install` and regenerates the autoload file, and then it works
@Danack I include lumen-framework in the project's main composer.json file
It looks like it's in the regular (non-dev) dependencies for illuminate/support
 
3:15 PM
I've found a half dozen techniques for doing before/after function hooks, and all of them have some sort of serious issue.
 
tell me all about it
 
Reliability in the face of exceptions is the hardest one for me at the moment.
 
well that's sorta why we need a new api
 
Right, which is why we are working on it :)
But day by day I think it's even more necessary than I realized.
 
Hi! Should session_module_name return 'user' right after session_set_save_handler?
 
3:18 PM
And still, I need a solid product for PHP 7, which is going to be around for a while. So I need to figure out all the right balance of hacks or something.
Is there a way to tell from an extension's standpoint where an exception will unwind to?
I need to understand this better.
 
Well... on localhost session_module_name return 'user', but on server same code return redis... wtf....
 
@LeviMorrison Have you checked the Go! AOP? It provides all possible type of advices: after, before, around...
 
@lisachenko Can it reliably trigger an after in the face of exceptions, and ideally even the Happy Case of exit?
 
@LeviMorrison it handles exceptions in original methods, but can't handle the exit keyword..
See github.com/goaop/framework/blob/master/src/Aop/Framework/… This is how it is implemented. $joinpoint->proceed() executes all nested advices and original method itself.
 
It looks like it can't actually intercept functions; it has to use the namespace hack. Is that right? I can't control the customer's code, so that wouldn't work for me.
 
3:33 PM
@LeviMorrison Next version will use z-engine library, thus it will be able to wrap internal functions like date, etc..
 
hm... found... if session.save_handler defined in php.ini - all work nice, if defined in fpm poo via php_admin_value - session_set_save_handler ignored... o.o is it bug or I am missing something...
 
@JoeWatkins My latest idea was to inject an object with a destructor into the local symbol table. In the return opcode, we can handle happy cases, and the destructor is there for unhappy cases. Two problems:
1) Injecting into the call's symbol table is difficult because there are no interception points (that I have found, at least) after the symtable for the call is made. 2) It also seems that there isn't always a symtable, which seems really odd except for ICALL.
 
Downgrading to composer version 1.6.3 fixed the issue, that's really odd
I guess when I reran composer install for it to work, I was using that version because it was installed on the box. But the deployment used composer.phar which was the updated version
If anyone was curious :P
 
@Alesana that's odd....and one reason why I normally put a composer.phar as part of the project and use that version on a particular project everywhere.
 
@LeviMorrison zend_rebuild_symbol_table() should help to rebuild the symbol table (from userland it can be fixed with get_defined_vars() function call.
 
3:38 PM
/And I remember a time a 'youth' sneered at me for doing that......as they thought not having everyone upgrade to the latest version of composer whenever made me sound old....
 
@Danack The best is to use the latest and greatest... delayed by a tiny bit so that others will hit these edges and you won't :)
 
If I posted a complete RFC without code, what are the chances it actually gets done? I'm kinda lost looking at the raw C
 
@lisachenko Building it is only half the problem; what will free it?
 
@LeviMorrison yeah....exceot the thing Alesana is seeing sounds like a change in behaviour....
@Machavity I strongly recommend posting it as a gist and getting feedback here before posting the list regardless of implementation being present or not.
 
@lisachenko Do you use opcode handlers at all?
 
3:41 PM
@LeviMorrison it should be your code...
 
@lisachenko Sure, but in the face of exceptions how do I do that reliably?
 
@LeviMorrison no, I just patch function/method tables with opcodes from closure
 
How badly does that affect performance?
 
Also, @LeviMorrison apologies for not replying to your ping about the next call; I have mostly been travelling and/or being sick. And, I'm about to jump on a plane to symfony con.....I believe you were going to write a code example to show the thing that was being discussed?
 
@LeviMorrison almost invisible.. replacing the pointer to original opcodes with another one during preload stage.
 
3:43 PM
@Danack We're going around now and downgrading all of our applications composer.phar files :P
 
@Danack I need to spend some time thinking about some of the feedback points from Nikita. He made some good points, and some others that I don't think will be "good enough".
I'm looking at what .NET does too, since that's been around for a while and is more robust.
Zend extensions can get notified of opcode compilation, but for some transforms that's probably too late. You can use the AST transforming process, but there's hardly any support there.
 
@LeviMorrison this should be possible, at least, in theory )
@LeviMorrison if you are interested in general after/before callbacks (aka AOP), we can work on this together, because it's my main target
 
I had some memory leaks when I did an AST proof of concept change. I need to revisit that, because I've learned a lot since then. For instance, we actually do leak on uncaught exceptions, and I know that's one of the things that was worrying me.
@lisachenko You would probably be interested in some of the work a few of us are trying to do for PHP 8.
 
@LeviMorrison yes, memory leaks are hard to debug and fix (
 
We're trying to get reliable hooks for before/after baked right into the engine.
 
3:47 PM
and what about around types?
eg. take a method and wrap it (like Python does?)
 
What do you mean?
Wrap is just a combo of before and after, so yes?
 
no, need to control if original method body should be executed or not. also need to receive a result before returning it back to the caller
Example: make a method cacheable
 
Oh, most of us have no desire to support such things. In fact, we'd really prefer that people don't do such things, because they do not play nice with other extensions.
 
before part is ok (if we have a value in cache, then return it)
 
For instance, if my extension and yours are both loaded, and you replace the call, it will not play nicely with my extension.
 
3:50 PM
but how we can store original value in the cache? (especially with multiple return points)
@LeviMorrison i don't use extensions at all ) Pure PHP and FFI )
 
In other words, our concerns are observability, not mutability.
 
@LeviMorrison Ok, I see...
(sorry, need to go) See you tomorrow!
 
Does that make sense, though? If you are swapping out or skipping code, it inherently kind of assumes that nobody else, including those other people doing similar things, will care. This is just not true in today's ecosystem.
 
user11867329
.NET, anyone?
 
4:17 PM
what about .NET?
 
4:27 PM
It has 3 letters, just like PHP
 
Is there some neat MYSQL way to calculate a time difference between two timestamps but only take into account work time which is e.g. monday - friday / 8 - 16 pm... so if the date is 2010-10-10 08:00:00 and second date is 2010-11-11 14:00:00 the result would be 14 hours
Didnt check if these were on the weekend
sorry the second day is also in October 2010-10-11
 
Work times are a very local thing
 
Yeah I'm sort of looking for a general approach
 
Hell it's even a very domain specific thing
@PeterTheLobster general and local/specific are opposites
 
You can have a general approach to a problem that can be applied in a specific context....
 
4:36 PM
People working on a shifts sometimes work 7 or 9h due to dst zone time changes
 
Well if it is a general approach for a specific problem it is probably wrong
Also if it is a general solution google should have your answer
 
There is no general solution and newer will be cause it's not possible to guess what happens in a future
 
What I mean is that for example the Dijkstra shortest path algorithm doesn't tell you if you are to apply it to navigation systems or networking... I'm looking for an abstract baseline that I could work off of
 
That's unrelated
And again general solutions can be readily found on google
Still trying to do it in mysql is most likely the wrong approach
But good luck o/
 
4:44 PM
hey joseph
 
yohaa
 
Ok, I typed up as proper looking an RFC as I could gist.github.com/machavity/c84dad59bbc4d7d37b2d6e6bfd654df3
 
> and mandating that they be passed by reference
Doesn't it have a bind_value method?
 
@PeeHaa I've never seen one. Here's the manual on bind_param
 
hmmm I was/am 99% sure it did
Is that pdo?
ah it is
 
4:57 PM
@PeeHaa Yep
 
execute FTW
:-)
But yeah improving that terrible API for people unlucky to be stuck with mysql seem nice
 
Oh, I'm stuck. If I could start over, I'd use PDO
 
Sucks that bind_param is also incorrectly named :D
And you have to fall back to the bit worse bind_single now
 
PHP hasn't been consistent in function nomenclature so far. Why start now? :P
 
If I reuse a position would it just silently overwrite?
 
5:03 PM
Hmm.. That's a tough one. I'm curious how PDO handles that
Could emit a E_NOTICE maybe?
 
Dunno... Again execute ftw :P
I would just indeed check what pdo does and do that
 
Do we have a hashing function for pointers in php-src already?
 
why do you need one, it's a ulong ?
 
That's what she said
 
pretty normal to ulong % tsize to hash of anything else ...
 
5:10 PM
@JoeWatkins Well, technically not, but if we already make that assumption elsewhere then I would do no harm by making it again.
Are all execute datas stored in an array? Like can I do a ptrdiff to the root?
 
on linux, that's a safe assumption
@LeviMorrison no, stack
now I've said stack, you are asking yourself why you thought frames would be in an array, right ?
I mean I guess they could be in an array, but but ... read more zend :)
(frames are different sizes)
 
Ah, right.
 
erm ... what you doing anyway ?
(I can think of reasons not to want to use the address, they are in principle reusable)
(even within a call stack, the same frame address may point at different frames at different times, that's the nature of how frames are allocated and free'd)
 
> Invalid parameter number: number of bound variables does not match number of tokens
 
what you really want is a hash of the frame, not it's address
that's much more complicated
 
5:23 PM
Came on the line with execute
 
@JoeWatkins Can you explain that some more?
For instance, if I have a zend_execute_data for the call, will it be the same one for the return opcode of that same call?
 
yes
 
What could cause it to point to something else?
 
@Machavity Yes if you bind more params than in the query
 
I already have a solution in my head for the fact they can be reused.
 
5:24 PM
Or is that just when overwriting?
 
@LeviMorrison okay then do that ... but it seems like you might be looking to hash the frame itself still ... if you can get away with not doing that, obviously that's better ...
 
@PeeHaa In this case I intentionally overwrote my first param multiple times so I had only one bound (against a 2 param query) when I went to execute
 
but correctness > speed
 
@Machavity yeah, but you want to know what it does for matching number of params, but overwriting them
Preferably based on PDOStatement::bindValue()
My guess is that it silently overwrites
 
And that's what I'm saying. PDO overwrites silently by default. Not sure if there's a flag you can set to get it to be verbose
 
5:27 PM
ah yeah
Neh that's just how it works in that case
 
maybe this is a thing the api can provide
like the zend ext api providing reserved space on op arrays, maybe instruments can reserve space after the frame, so that this problem goes away
?
I did start to play about with an extension ...
if we could reasonably do these things without modifying zend, we would already be doing them ... we can't, and it feels like a waste of time ...
let's just sort the api, then write the patch, as quickly as possible ... we can try not to break abi so it can be merged into the 7.4 branch at some later stage ... I think we have to have a more long term view of progress here ...
we've been stuck with more or less what we have for ... I dunno, forever ... for it to take a year to fix it is no surprise really ...
 
Yeah. My concerns are two-fold: I need to support PHP 7 in a better way than I do today, and we definitely need to fix this better for PHP 8.
This hashtable business is for PHP 7. The idea is to store my opened spans in the HashTable, keyed by the zend_execute_data *. Then in the return opcode handler I remove it fro the HashTable and close the span. If I go to put something into the hashtable and that pointer is already used, then I know that one is stale and needs to be closed. Then at the end of a request, any items in the HashTable get closed.
 
well I think the instruments stuff has to be a long term plan ... if we could write this platform as an extension, we wouldn't need to talk about modifying zend, it's not possible ...
 
In these cases where I'm closing due to it being "stale" or whatever, it's not going to be as feature rich, but at least it 1) doesn't leak and 2) gives it a chance to do something, such as indicate there was some sort of error and it was auto-closed.
 
Ability to get all client headers – #78844
 
5:41 PM
will that work for generators ?
 
Generators are already kind of weird today in ddtrace. I'm not sure what the Right Thing is for generators, but I don't think this is worse than what I'm doing now. I think.
It's a good point though, and I'll be sure to double-check.
 
I can't really brain a better way off the top of my head ... some rough ideas are forming
 
The other idea would be to store the execute data pointer in the span, store the spans in a growable array, and then use it kind of like a stack, searching from the back for the execute data.
 
they probably won't come to anything, but something about reversing and or merging your current idea of open/close and or using control flow graph ...
I can't really concentrate properly right now, house has too many humans making noises
 
Using an AST transform is definitely possible, but that's going to take a lot more work and I have a more urgent need I need to spend time on.
There is zero support for doing AST transformations. There aren't any helpers for resolving the fully qualified names, for instance, or knowing if you are in a class definition.
 
5:49 PM
cfg is built using final form, opcodes
 
So you have to reimplement those bits from the compiler. Not the end of the world, but it means more work to get it off the ground.
@JoeWatkins How far back do we have a CFG?
 
we don't, opcache does, you have to copy it (like pcov does)
 
Lovely.
 
it has within it all the basic blocks of the function, including calls ... I'm thinking, there's something in that ... it may not be necessary to dinstinguish close from open, if you can ...
sorry I can't think properly, I'll try to later on ...
the entry to one block implies the exit from another
 
I saw some work from someone in asia (which I point out only because I can't understand the docs very well) that uses AST transforms, but they actually serialize the AST back out and then include that. This updates line numbers and such.
For reading later ^ @JoeWatkins
 
6:00 PM
mornings
 
 
2 hours later…
7:35 PM
Wish me luck trying to figure out how to compile PHP on W10
 
7:48 PM
Good luck ... poor sod
Write a script for it to share :p
 
8:12 PM
Step one installing the tooling lol
 
shite, I was under the impression PHP would ignore the hashbang line (like always) but this does not work including a file that starts like:
#!/usr/bin/env php
<?php declare(strict_types=1);
# ...
because: "PHP Fatal error: strict_types declaration must be the very first statement in the script"
 
@hakre No. I recommend putting your code in a file that another "executable" includes.
 
yes, but that then prevents the one-file solution I currently have. needs me to pimp the build.script to inline the include then. or switch to phar but somehow not yet. hmm. must a phar file be named *.phar? questions over questions ...
 
@hakre That should totally just work
Do you have a BOM by any chance?
 
no, the fatal error is from my test. it's reproducible.
if I remove declare strict there, it works.
test script is:
#!/usr/bin/env php
<?php declare(strict_types=1);
include __DIR__ . '/../pcre.php';
the include here triggers the fatal.
this is kind of a pity, because I was just trying to use the backtrace count to find out if the file is getting executed or included.
having all definitions on top would have allowed me to use it as a bootstrap file in phpunit and then just write unit-tests.
this would have been totally straight forward.
 
8:29 PM
ah it only ignores the hashbang from the execute file
Not from the file being included
 
yes, but it should here, too IMHO.
 
I think I agree
 
(or at least right now it's me who just wants to play with that ^^)
fun aside, I could imagine this could be something portable.
 
well I would say "normally" you wouldn't include files that are meant to be ran as "binaries"
But I can see it being done either way
 
yeash, it would be a mixed mode file (two souls are living in me), maybe in the spirit of this PHP 5.2 ini directive: cgi.check_shebang_line=1
but I don't want an ini directive (and the one doesn't match anyway), I would need this as default right now. Meh.
 
8:35 PM
> PHP 5.2 ini directive
All those things make me want to throw up :P
 
throw up is like give up?
 
As in puking :D
 
okay
well it's most certainly a bad idea anyway to include such files for like normal include.
can imagine there could be some security implications here.
 
@hakre yeah
 
I will try to setup a stub file, do a build etc.
but we could have it have sooo nice ^^^
I can remove the declare strict .... hmm ....
 
9:10 PM
Is "Settings defined with php_admin_value cannot be overriden with ini_set()" means that php_admin_value[session.save_handler] cannot be overriden by session_set_save_handler?
 
9:22 PM
So should I create bug issue or it's just feature :)
 
00:00 - 22:0022:00 - 00:00

« first day (3322 days earlier)      last day (1609 days later) »