« first day (3314 days earlier)      last day (1619 days later) » 

5:09 AM
\o
 
5:58 AM
@NikiC @bwoebi thanks for words, I get it now ...
 
 
1 hour later…
7:04 AM
posted on November 12, 2019

![ AI Training Datasets](https://www.monkeyuser.com/assets/images/2019/157-ai-training-datasets.png “”)

 
7:16 AM
@JoeWatkins Dare I dream that ilimit does what github.com/sebastianbergmann/php-invoker/blob/master/src/… does, but better?
 
yeah, basically
 
someone has agreed to sponsor it's development, with specific requirements, but it looks generally useful I thought, so we agreed it would be open ...
 
Good morning. I am test some legacy code with existing tests. I see an incomplete test but phpunit does not report which is the related function. Is there a way to ask PhpUnit to inform me about the incomplete test ?
 
7:55 AM
morning
 
cmb
\o
 
8:13 AM
good mornings
 
8:47 AM
o/
 
o/
 
9:38 AM
@NikiC @Ocramius what we talked about yesterday in a first api brainstorm: gist.github.com/beberlei/712f48fcf6e1db9a793effbba1ad9686
 
 
1 hour later…
10:39 AM
gallimaufry a hodgepodge; jumble; confused medley.
 
10:51 AM
morns
 
11:06 AM
SimpleXMLElement::count result different – #78805
 
11:17 AM
@JoeWatkins are we likely to be graced with your presence?
 
it seems unlikely at this point ... I can't find a way to afford it, it's not just the hotel and so on, but the having to pay for taxis four times a day to get kids to and from school (I couldn't find anyone to do it for me) ... I probably can afford to come out on Friday (because it happens to be payday) if there is anyone still around, but nobody should stick around on my behalf ... sorry, I suck ...
 
Fair enough, and no you don’t suck just have your priorities with family.
 
12:08 PM
@beberlei why not something like a built in Proxy factory class like in JS or Java ?
 
12:38 PM
Morning all
 
o/
Anything interesting happening in PHPLand? I've been too swamped IRL to keep up
 
don't think so
 
fair dos, thanks
 
12:54 PM
MS-DOS was a fair dos
 
C dos. C Dos Run.
 
user10141648
1:39 PM
Hello,
This is my current code:
$firmwares = Database::Instance()->firmware->get(array('FWV'=> '%'));


foreach($firmwares as $key => $fwv) {
$versions[$fwv['id']] = $fwv['FWV'];
}

I want now to filter out all $fwv['FWV'] under '7020' when $device['version'] is < '7020', how can I do that? Can I use a function?
 
So coming back to my SCRIPT_NAME issue I asked about recently. I am not making much progress. This is my setup. Anyone know why the SCRIPT_NAME is empty in the first case? Am I just missing something or is it a bug?
 
user10141648
1:54 PM
I found out already. Don't need help anymore :)
 
Bugger. I knew I should have used Go for my personal IRBM fleet.
 
Interracial Ballistic Missile?
 
Intermediate Range. It's like Intercontinental, but more suitable for orbital nuking of the nearby Tesco for running out of my favourite biscuits
 
@Gordon you don't have FixPathInfo enabled somewhere?
 
@Sjon it's mod_php not mod_fcgid. does it still apply?
and no, it's not set anywhere
 
2:33 PM
@Gordon it's a mystery to me where SCRIPT_NAME comes from in mod_php, it's not listed in github.com/php/php-src/blob/master/sapi/apache2handler/…
 
o/
 
@Sjon yes, same here. I am pulling my hair out over this
 
2:43 PM
it sounds to me like a bug in apache. It makes very little sense, whenever you use the full match ($0) to lose that env var.. When using a specific match, no problem.. no matter the rest of the config
 
getenv cb will read SCRIPT_NAME from env, and populate sg with it
(the problem is upstream, if it were set it would be available)
break here and watch what happens
@Gordon all of that
 
thanks, will take some time for me do that. I am still slow with gdb
 
sudo gdb -p PROC_ID_OF_APACHE_WORKER
break php_apache_sapi_getenv
p name
if it's SCRIPT_NAME do n until after the apr call and inspect result (p env_var)
(hit script after break is set, obviously)
if it's not SCRIPT_NAME do c
 
@DaveRandom are you at the barcelona thingie?
 
We miss you @JoeWatkins. Totally understand, but would have been awesome to see you here again
 
2:53 PM
:( :( :(
in case not clear, I'm very sad ...
 
Oh, totally. I heard it was due to something significant. Just saying :)
 
Morngins
 
I need a new rubber duck
my current ones are too busy
 
:D
 
talk at them anyway
that's the beauty of a rubber duck
ohai @PeeHaa
 
3:06 PM
@JoeWatkins my rubber ducks are people though :S I feel weird rambling at an inanimate object
 
\o
 
I'm doing it right now, in my head ... so are you ...
o/
 
I remember one of my employers having to give all the everyone 5 rubber ducks.
 
"having to"
I prefer wages myself
 
here i taught i wasn't alone in rubber duck talking business
 
3:08 PM
I use a gimp suit
not for debugging, just as casualwear
 
I dont like those. it just make everyone loud even when you want to focus.
 
lol
fortunately I'm an office of one at the moment
 
@Tiffany good for you. Thats my dream job.
 
lose your job, live off your savings...
still your dream job? :D
 
nah i take it back.
no unemployment benefit. I mean instead of your savings?
 
3:15 PM
I wasn't able to because I was dumb, but that was back in February
I think unemployment only lasts up to six months anyway
 
@JoeWatkins Could I ask for your help with dark magic? )) What should I do in order to replace an internal one function with user-defined closure? I have a feeling, that PHP already has compiled opcode for this function that tries to execute ICALL, right?
It ends at ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER with expecting segfault, because it works with zend_internal_function and corrupts memory...
 
@lisachenko The fact that uopz doesn't do that makes me suspect it no worky (it does something slightly different, see uopz_set_return())
At a guess you need to replace the internal function with another internal function which acts as a proxy for the userland function
that's literally a guess though
 
@lisachenko you have to set compiler options so that DO_FCALL is always emitted, another option is define an internal function proxy for the closure so that you always replace an internal function with an internal function ...
 
yay I guessed right-ish
 
@DaveRandom yes, think so... Is there any existing one available in PHP itself?
 
3:24 PM
you will have varying degrees of compatibility with opcache depending on how you do that
(and ZE itself)
 
@JoeWatkins ok, I see now...
 
if you memset the original zend_internal_function, you are not compatible with zts, if you don't you're not compatible with opcache (it caches the addressof internal [known] functions)
 
Maybe, user opcode handler that changes the opcode for DO_FCALL also can do this trick...
@JoeWatkins yes, this is where I stuck now...
 
at preload stage, you can insert a module ?
actually at preload stage you should be able to safely memset an internal function (or set the function_handler to a proxy)
 
@JoeWatkins I can try to set global compile_file hook, it will be applied for subsequent includes, not the first ones...
 
3:30 PM
but at runtime, the engine doesn't want you to do this, it makes assumptions in core and in o+
 
@JoeWatkins Unfortunately memsetting zend_internal_function is not a good idea, because it has different size with zend_op_array used for user functions...
 
no no
you define an internal function as a proxy that calls the user defined closure, and memset the original internal function or set the handler to the proxy ...
 
or it has same size for all _zend_function? (which is union)
@JoeWatkins ah, that way...
it requires a lot of stuff to do to define an internal function from the PHP side...
 
Does anyone remember what RFC/improvement was responsible for this change: report the line of what signature is wrong instead of its class? 3v4l.org/dj5Up
 
@lisachenko so make more api ...
 
3:35 PM
@JoeWatkins ))
 
what about defining zif_handler ?
 
@JoeWatkins this should be easier, indeed...
just raw pointer... I can even try to setup a callback from FFI directly...
 
I'd probably go that route anyway, I think this might be safe at runtime and in zts ... so long as you fetch the address of the internal function at runtime and not during preload (because in zts it will change) ...
(also safe at preload stage)
 
ZTS is not supported right now, so I can work with nts structures only
Thank you, this way it should work at least...
 
then safe all the time
 
3:40 PM
Ok, perfect
And what is stored in zend_closure->orig_internal_handler? It has zif_handler type as well...
 
closures are private
treat them as such
 
Wrong open_basedir warning – #78806
 
But it's easy to use them from PHP side, looks good for function/method redefinition
 
Cool, lxr alive ))
 
3:44 PM
I thought you might ignore the words, but I said them anyway .... and you should remember I said them ... I've made this very mistake ...
 
@lisachenko wait wat?
 
it's adams @DaveRandom
 
I'm still waiting for my stuff back :-/
 
@DaveRandom was surprised by the previous link, not an official one, but works )
 
oh adam's
 
3:46 PM
using them is fine (there is an api to get the op array from a closure, so also fine) but relying on the internal implementation details of an opaque type is not a good idea, don't do it ...
 
4:10 PM
Just have managed to intercept internal function )) But at the end it corrupts memory because of my dirty trick with PHP native values <=> CData mapping.. Not sure how can I change that...
#0  0x0000000001628ff0 in executor_globals ()
#1  0x00000000009130b2 in zend_hash_destroy (ht=0x7fffffffb020) at /home/alisachenko/src/php-src/Zend/zend_hash.c:1560
#2  0x000000000057edaa in zm_deactivate_ffi (type=1, module_number=10) at /home/alisachenko/src/php-src/ext/ffi/ffi.c:5136
#3  0x0000000000906e1d in zend_deactivate_modules () at /home/alisachenko/src/php-src/Zend/zend_API.c:2629
#4  0x0000000000866408 in php_request_shutdown (dummy=0x0) at /home/alisachenko/src/php-src/main/main.c:1899
 
yeah that's corrupted
 
It can be either bug in FFI itself or side-effect...
 
is that the pDtor call ? it looks really odd ...
 
I'm not sure what's happen there...
This method accepts one argument, then navigates EG to detect corresponding arguments and their zvals and just do rude copying...
 
it looks really odd ... but I don't really know what it's doing or why, I still haven't had the time to review the thing in depth ...
 
4:16 PM
@JoeWatkins most tricky parts are in this particular class, because it fakes structures to have an ability to map values directly from PHP side to zval via stack trace and vice versa...
 
wtf... [&$a, &$b, &$c][$val] += 1; => Fatal error: Cannot use temporary expression in write context
 
What it is interesting - that I can write $zendInternalFunction->handler = function () { echo 'Wow'; } directly with FFI itself, but arguments and return values can not be used, need to put correct zval-s at the return_value structure...
 
@bwoebi stop writing insane code :-P
 
@bwoebi omg...
 
raises eyebrow ... &$a works? orly
 
4:32 PM
@JoeWatkins it's working with latest PHP-7.4, woot ))) So, it was a bug in FFI..
Implementation of internal function redefinition looks pretty easy:
    $this->pointer->handler = function (CData $executeData, CData $returnValue) use ($newCode) {
        $rawValue   = ReflectionValue::fromValueEntry($returnValue);
        $stackTrace = debug_backtrace(0, 2);
        $result     = $newCode(...$stackTrace[1]['args']);
        $rawValue->setNativeValue($result);
    };
This mocks zif_handler with PHP closure callback, wraps/unwraps values to internal structures and stores a result in the $returnValue zval...
 
@DaveRandom what's insane about that except that PHP is too insane to understand my sane code?
 
$readability-- yo
or maybe more like
 
@DaveRandom (it was actually spanning multiple lines with an array key on each line)
 
$foo = 'readabi';
$qux = 'QUALITY';
${strtolower($foo.substr($qux,3))} += -(!false);
 
@DaveRandom your first version was better :-P
 
4:48 PM
eh, very much having a don't-give-a-fuck-about-anything time rn
semi-related, I'm thinking of finding a cave to live in, maybe in the Yukon or something
 
@JoeWatkins you gonna be at php barcelona yet?
@GabrielCaruso I think I fixed that as part of the variance implementation
Added a new API for reporting an error at a certain file/line, instead of determining it automatically
@bwoebi ...
 
5:05 PM
@NikiC I see you like it and want to fix it as soon as possible - right? :-D
 
@bwoebi :P
 
@NikiC I mean, there's no technical reason why this error exists on array derefs?
or would it leak if not?
 
Wes
@GabrielCaruso you can't restrict mixed to object
arguments must be contravarient
 
@bwoebi It mainly exists due to TMP vs VAR
 
@NikiC though on the lhs it wouldn't really matter if it were generated as VARs
perf-wise I mean
 
5:15 PM
@bwoebi yeah, it's just a general thing that all the "write" operations only accept VAR
It would probably possible to also accept TMP
Though it would also be necessary to change other stuff relying on the distinction
 
ah no, I meant a [] on the LHS should emit a VAR directly
so that the current assumption write context = VAR input still holds
 
yeah, but that's a workaround
[] can't be a ref, so var makes no sense
 
@NikiC but it can hold a value containing a ref
I mean [] = $foo would still not work, only [][$a] = $foo;
(or concretely [&$var][0] = $foo)
 
@bwoebi but that's not what var vs tmp is about ^^
I understand what you're saying, I just don't think it's the right way to allow that
 
@NikiC yea, but derefs of arrays return tmp if the array is tmp, otherwise var?
okay
 
6:02 PM
Morning/Afternoon!
 
6:14 PM
@bwoebi there is no array deref as such here, but an assign dim
and the operand of the assign dim is an init_array/add_array_element
 
6:30 PM
my ten dollar second monitor bit the dust ... bollocks
 
Is it possible to define function using FFI and add it to functions_table in PHP?
I mean defina/declare function in C but add it to functions_table using some PHP and FFI extension?
 
6:56 PM
Ahh I think not, nvm
 
7:08 PM
I think I never finish what I started and am always unsatisfied of myself somehow then trying to find some new interesting idea I can evolve on forgetting about other things I had in my mind.
I think I should revive all of my recent ideas and try to finish some...
It's late, feel ill and saying weird things, don't listen to me
:/
 
 
1 hour later…
8:29 PM
@NikiC ah, true, it's directly assign_dim, not a dim_fetch_w+assign
 
9:01 PM
!!reboot
 
@StatikStasis I'm sorry Dave, I'm afraid I can't do that
 
@PeeHaa Down in playground- reboot here did not fix.
 
!!reboot
 
Restarting now! o/
 
I will make you admin here too
!!admin add 3640934
 
9:03 PM
User added to the admin list.
 
there :)
 
9:18 PM
@PeeHaa ty
 
9:54 PM
too much Only Fools and Horses, all I can think of is youtube.com/watch?v=ylgV8OyTIFg
 
10:13 PM
o/
 
10:27 PM
o/
 

« first day (3314 days earlier)      last day (1619 days later) »