« first day (3907 days earlier)      last day (1035 days later) » 

12:02 AM
One thing I don't grok... is zend_compile_dynamic_call() an ast compiler function or a utility function?
Because its API is different than what zend_compile_pipe's signature has.
Oh, it's a utility. No wonder none of the variable names make sense.
OK, well, I'm back to core dumps.
void zend_compile_pipe(znode *result, zend_ast *ast) /* {{{ */
{
	zend_ast *expr_ast = ast->child[0];
	zend_ast *name_ast = ast->child[1];
	znode expr_node, name_node;

	zend_compile_expr(&expr_node, expr_ast);
	zend_compile_expr(&name_node, name_ast);

	zend_emit_op(NULL, ZEND_INIT_DYNAMIC_CALL, NULL, &name_node);
	zend_compile_call_common(result, name_ast, NULL);
}
/* }}} */
(I've another call in 15 min, so have to stop for the night at that point.)
 
12:27 AM
That's closer, but probably still not right. Now the name_ast gets compiled twice.
 
That may be why it segfaults...
 
You need to emit SEND_VAR_EX .. or maybe some other send. We have a few of these too.
 
SEND_VAR_EX?
 
But that's something someone like Joe or Nikita will probably know how to fix right away.
 
I'll have to bug them tomorrow, I guess. My call starts now, so I have to go.
 
12:30 AM
zend_compile_call_common will do this, but you don't have an AST to give it.
 
Thanks for your help!
 
1:12 AM
Sorry if this has already been discussed in this room in the last 3 days, but I am wondering how a PHP Collective might decide its Admin and Member users on Stack Overflow (if the feature is allowed to go forward). For the record, I am not expecting an invitation -- just curious about the algorithm.
Will Admins be any "People with php.net VCS accounts that have contributed code to PHP"? Do they need to contribute with some recency? How will the Admins select "trusted" representatives as Members?
 
1:31 AM
Well, I guess what I meant to say was: will the Admins consist of the panel of people who have voted in RFCs? Or maybe recent RFC's?
 
2:17 AM
I feel comfortable generalizing that the majority of regulars in this PHP chatroom do not regularly take part in the main platform
Some may have at one time or another, but activity has slowed within the past couple years
 
2:34 AM
@Danack @NikiC ping
 
 
2 hours later…
4:50 AM
pecl.php.net down, at least from the US
Wondering if I should open a bug report but seems frivolous
 
looks down for me, too.
@Tiffany port 80 looks down
well not really.
and now its there.
@Tiffany: Please try again, I see it again.
 
Yup, up for me
I was browsing reddit and someone posted asking if it was down, I was able to reproduce
 
5:10 AM
for me it kind of ... hang .... one error in browser ... telnet 80 connect ... GET / hang ... and then it worked.
maybe it needs port knocking ;)
 
 
1 hour later…
6:27 AM
Hello, can someone answer me a question about php?

I have some php code in my index file and I want it to run only on the server but not on my local machine because I have the databases only on the server.
 
6:54 AM
@CrynetOmega so even you have one index.php it should work with and without the database? or would it be an option you have a database as well on your local machine?
the general suggestion is to have something called feature flags, and you perhaps want to have the database as a feature. In PHP this can be done as easy as having an array or an object and you can then conditionally execute the code of the feature with if ($feature->database) { ... }.
the other general suggestion is to have the development system in near parity with the production system. that is, you have as well a database server locally for example.
this normally removes such structural problems and will allow you a more fast forward development.
 
hey thanks for the answer, i will check out these feature flags.

I don't have a database on my computer because i can't get xampp installed. (macOS) -> the file I load from the xampp site always fails to unzip, so i always start my php files with php -S 127.0.0.1 via the command line
 
which database are you using on the server? maybe you can just install the database server locally. for development webserver you can still use the PHP one.
and before using feature flags you should use a version control system. do you have one at hand? for example git?
and to mitigate the problems you may have by dividing the code-base through feature flags (or configuration in general), one valuable thing to introduce early is to have the build and deployment process automated.
 
mysql; Yes Iam using git for this project - Im trying to install xampp again, these flags might be to much for my simple homepage haha
 
7:10 AM
@CrynetOmega well even if you would have the feature flags, you couldn't develop the database part locally. having the database locally then is the bigger win, true.
 
yes, you are right. it would also be useful for other projects to have a running database environment.
 
@CrynetOmega yes, good point. and it perhaps makes more fun, too!
if I remember the times when I got my first apache running. and then the mysql server. this was just great.
 
I have now managed to install xampp. It was downloaded as a bzip2 file and I just had to change the file type to .dmg ...
 
8:15 AM
I have now encountered another problem.

I have on my server a public and a private folder, the private is only readable by the user and contains scripts to connect to the database, username, pw and so on.

All htm, php ... data is in public and when i call the site from the browser it works also that scripts from the private folder are executed but not visible for the client.

Now with xampp it tells me that the permission is missing to read and execute in this folder.


Here it is said that you should set the permissions for the www.data user, but this is again a high risk or not? https:/
 
8:25 AM
on your local development server this should not be a security issue as only you have access.
and the issue you have with xampp, is it about the private or the public folder?
 
I do, however, occasionally deploy my stuff to the webserver, but I don't always want to change the permissions.

i am creating my own user for the xampp activities and will give him the permission for my project directory
private
 
xampp (better: the webserver, apache) runs your php so php needs to be able to access both public and private folders.
but the webserver should not host the private folder, that is, giving access to files in it via HTTP.
the later would be a security issue, the earlier is a technical requirement.
so for the own user you created for xampp, give it access to the private folder, too. that would be correct.
 
yes thats what Iam trying now(:
 
just setup apache properly to host only the public folder. e.g. set the document root to it.
this should be similar as you had it earlier with the php dev server.
(if you were setting the document root with it, otherwise it's the working directory)
btw. you can run the mariadb server from xampp with the php development server, too :)
 
On my webserver the public folder is the root.
the private folder is in the same directory as the public.

I had made the private folder visible and executable only for me, because my prof told me that this is the way how it's done.

So i can make the private folder also visible, because clients have no possibility to access it anyway?
this is my directory structure (simplified)
private (drwx---)
- db_connection.inc.php
- xxx_keys.inc.php
public (drwxr-xr-x)
-index.php
-other.php
-projects
--project1.php
so i can set my private folder to drwxrwxrwx
because nobody can access it, because my root is the public folder?
 
8:46 AM
well, yes and know.
> the private folder is in the same directory as the public.
> On my webserver the public folder is the root.
 
yes
the root for the entry from the web
 
this is what your prof most likely meant: you should not host anything but the public folder with the webserver only.
 
is if i go to my homepage xxx.com/ it goes to the public folder
 
so then it's fine. the access rights on the file-system are on a different level.
for hosting, control with the document root.
that is public then, and the folder is named public, so this is visible.
everything else then is automatically private.
the index.php file then is your entrypoint.
that is, apache finds it in the public folder and then will command php to execute it.
php takes over and runs the script (with the apache user it likely is).
 
All right, thank you! I'm not quite up to it yet. Wouldn't it also be possible to access data from folders outside the publics folder via an ajax request (in the browser console)?
 
8:51 AM
now php needs to access some files that are not in the public folder. like the configuration file of your homepage or other php files like libraries or your modules.
@CrynetOmega the browser, incl. AJAX, always goes over the HTTP interface to the server. so if the server does not allow access to it (host it), it's not accessible.
this is why it is important that you can precisely configure what is public and what is not public.
 
@hakre ahhh okay !
 
mind the gap: your php script does more than the webserver, e.g. it fetches data from the database (which is not accessible by the webserver) and then returns it via the webserver. So the PHP is broaden the access (which is your intent) but if the code is written sloppy, it might do more than what you intended.
same for the file-system. with the access-rights on the file-system you can further control what PHP is able to see or not. e.g. if you've got your project under your user folder (home directory), PHP might only need to have access to the public and private folders in your project (or perhaps the project root) but not outside of it.
 
thanks for the clarification, i was not quite aware that only what is in the public folder is delivered. i thought it was simply an entry point from which higher levels can be accessed like in a normal file system.

by sloppy do you mean that i don't check for input errors for example and thus open the door for xss?
 
@CrynetOmega for example, yes. just keep in mind it's not a static file that the webserver just serves as-is, but it dynamically runs.
 
@hakre That was exactly the case here. on the webserver php can access everything everywhere, on my local machine this only worked for folders accessible to "others
 
9:00 AM
@CrynetOmega that is because on your machine PHP runs with the user of the apache webserver.
on the server, the configuration is similar but different. there the user PHP is run under is normally pre-configured to access most of what is your concern when you interact with the webserver.
just as a default setting. the development server you have to configure your own and you're quite mastering it already, very good!
this is also a benefit of running the webserver or database server your own locally: you've got a sandbox to play with and get a better understanding and some practice.
also you can hack yourself and try to attack your configuration.
 
@hakre haha hey thanks! well i'll maybe get back to you if i'm tearing my hair out again
 
bring it on, then bring it down :)
 
@hakre this will take some time. at the moment i'm just setting up my own homepage, contact form and one since my work is already there, but now i want to save my posts in the database to search for tags and other content dynamically.
 
 
1 hour later…
10:10 AM
Is there any reason the sockets extension can't be found via search on php.net?
But the page is there. php.net/manual/en/book.sockets.php
 
cmb
works for me
 
@Girgias Huh, ini_set already changed to allow bool on master. 3v4l.org/0eeaj/rfc#focus=git.master github.com/php/php-src/blob/master/ext/standard/…
Nikita saw it coming. github.com/php/php-src/commit/…
@cmb To clarify, I see the functions, I just don't see the extension.
 
cmb
10:27 AM
I don't think any extension is shown there. Just pressing enter should redirect you to the book, though.
 
"soap", for example, shows an extension entry below the function and class list
 
cmb
oh right; no idea why that isn't shown for sockets
 
11:21 AM
@mickmackusa the fundamental problem with pretty much any community 'platform' provided by some company that want to promote that platform, is that the interests of the company and projects that already exist do not align.
In particular, every platform that seeks to grow and get more people using it, is fundamentally at odds with communities that don't necessarilty want to scale beyond a certain size.
And this is one of the concerns I have with moving more project stuff to github. Github is clearly aiming to be the standard platform used by developers, and to make money off of enterprise customers. But communities need to be able to manage who can interact with the project, as having every developer in the world come knocking on your door is annoying. I made some notes on what I think Github should do here
But again, that's not in the corporate strategy they have, so they aren't going to do it.
Jun 19 at 15:28, by Danack
I just finished reading https://www.amazon.co.uk/Working-Public-Making-Maintenance-Software/dp/0578675862 ....the first half and the last ten pages of which are worth reading.
^^ that's probably worth reading btw.
In particular related to SO's collectives idea "I am so pleased to announce that our first two Collectives are Google Cloud and Google’s Go Language." - Google are so terrible at managing their own documentation and interacting with their users, that collectives might be better than their current situation for them.
Though :spocks_eyebrow.gif: at "Google’s Go Language.", as I thought it was meant to be open source.
 
11:39 AM
On the other hand, if someone wants to step up and manage a PHP collective on SO, then I wouldn't try to stop them. I just wouldn't want it to take any time away from contributing from the actual PHP project.
 
... anyone else think of a Borg version of PHP? ... just me?
 
You should know what I think about
 
and who is going to play 7 of 9
 
I'll spray the mankini silver
 
 
2 hours later…
1:19 PM
@IluTov Huh, well that's great, sorry for not really being helpful otherwise
 
2:06 PM
@Girgias Lol no it's totally fine. I looked through all tests and there don't seem to be any other annoying function that need to be changed.
 
[ FEATURE ] StructType like interface for arrays ・ *General Issues ・ #81203
 
cmb
@Jeeves your welcome! :p
 
2:22 PM
PHP 8 crashes with Access Violation on Apache restart ・ Apache2 related ・ #81204
 
Lol
@cmb also your welcome who?
 
cmb
3:33 PM
@Tiffany feature request ends with "Thank you!" I'm supposed to reply with "You're welcome!", am I not?
 
@cmb yes :P sorry, bad joke about the use of the possessive "your" instead of the contraction "you're"
You're becoming a native speaker :P
 
cmb
I'm already a native speaker – not English, though. :)
 
Touche
My sister gets them regularly mixed up, it still makes me fidget.
 
3:56 PM
English isn't as structer as you might think.
 
Does anyone know off hand if there's an existing userland partials library?
 
Ty, so this is using Functional\placeholder in place of ?
 
@MarkR auryn could do it with $injector->buildExecutable and a custom set of params. But maybe not positionally.
 
4:16 PM
@MarkR Yes, or you add use const Functional\…; and then use , note I have never used that myself. I know the library, some of the helpers are pretty nice, I've never gone that far with functional programming.
 
4:34 PM
oh man, I just realised what that … was x_x that's both impressive and crazy and should never be done
 
@MarkR Have you not seen sgolemon/table-flip?
 
But... that other library looks like it's actually used :|
I guess still not quite as interesting as the guy who used greek angle brackets to add generics to ... Go I think it was? to google
 
@MarkR I can see the argument for using … since in a monospace font it's going to be really obviously one character (still wouldn't do it myself), but that's just horrifying.
"c++ allows 0-width spaces in variable names. Where's your god now?" lol
 
5:11 PM
github.com/ndenoncourt/alcohol ... lol ... "so we can composer require alcohol"
 
5:32 PM
@Tiffany No unit tests, how are we meant to know it matches the correct ABV
 
5:51 PM
@Tiffany oh my goodness there is a "tabarnak" in there, that's an Québécois.e like me!!!
@IGP so I guess my first feedback about this is I actually visited it a second time to continue reading. It has design decisions, which are made clear, that's refreshing.
 
...
 
oh, that's not related to the OS...
 
no, but I appreciate how interesting it is that I have probably never actually accomplished what I set up to do in a way that's close to these guys :)
got to fly, laters
 
6:58 PM
 
o.O?
 
7:27 PM
@MarkR I've seen a few libraries over the years that do basically what lars's library does.
 
so it's called partial application for parameters. how is it called for returns?
 
huh?
 
?
 
does it exists?
e.g. I have a function, it returns a number, let's say integer.
 
it makes no sense. it "partially applies" parameters to a function, so that you can call it with fewer parameters elsewhere.
 
7:32 PM
and I do the XXX with it and now it will always return an array (with one integer inside)
so before the result was never traversable, now it is always.
 
That sounds like a wrapping function. not partial application.
 
@hakre are you referring to the library that was linked above, or the RFC for PFA?
 
@Tiffany I was referring to none of those directly, I was wondering given there is a term for input parameters, if there is one for the return "parameter(s)" as well.
in the meantime going to the kitchen make myself a wrap.
I call it a partial reapplication. (maybe)
 
@hakre I think you're greatly misunderstanding the terminology.
Partial application is specifically and exclusively about input parameters.
 
7:47 PM
@Crell a wise man once said: things you don't understand you can't misunderstand.
 
If you're talking about taking the return value and casting it "up" to something else (eg, int to array of int), you're looking for a functor, probably.
 
isn't a functor a function that returns a function?
 
No, that's a higher-order function.
 
or was it just generally a higher order function?
ah okay.
 
A functor is a function that maps from one category to another.
 
7:49 PM
and what is a functor then?
 
I have a whole book on this topic. :-)
 
yes that's great, and you read it for me :)
okay well, saying category is a bit unfair.
is that Kategorie as used by Leibniz?
 
I don't know from Leibniz. Category in this case is anything that follows category rules.
More specifically, in this case, you're lifting from "types that exist in PHP" to "Arrays of types that exist in PHP". both of which are categories.
 
well from scalar to interval of scalar
speaking in categories.
 
You can define categories in all kinds of ways, depending on what you want. That's what makes them both powerful and confusing. :-)
But back to the original point, if you have a function from int -> int, and you want to mutate it into a function from int->int[], then partial application is irrelevant. A functor is what you're looking for. (I'm 99% sure.)
 
7:55 PM
sure, but see it this way. let's call the function that does int -> int[] vectorint(int $i): Array|int[]
what I want to do is that I want to partially re-apply the first input parameter.
 
/me is about to disappear for a phone call.
"Partially reapply" isn't a word. Write the function you mean. :-)
 
well the function is already written. but I want to pre-apply (maybe a better word) it on another functors return value.
 
I don't understand what that means.
Write code.
 
yeah, right, full or partial pre-application of a functor.
 
Back in ~2 hours...
 
8:01 PM
add($a, $b) {return $a + $b;}; $partial = partial(add::class, 4); $preapp = pre_applied(vectorin::class, $partial); $partial = partial($preapp, 6); var_dump($partial()); // array(1) [10];
I put the partial preappliction in the middle for symmetry.
it's partial because it has a functor as input that is a partially applied function.
 
8:32 PM
If higher order functions had an inequality operator... would that make them a ordered higher order function or a higher ordered order function?
 
I think the correct term would be higher ordordered funcfunction
 
I just learnt that what I imagined earlier is just called function composition.
@MarkR how can a function have operators?
 
8:48 PM
Higher odor function, code smell? (dunno if it'd actually be a code smell)
 
this function is really of higher odors.
sounds pretty diplomatic in code review I guess.
 
"your function is pretty odorous"
 
NFM - nonodorous for me
if you can even say so.
 
Normal For Manchester
 
NFM, RTM & ship it!
 
8:54 PM
RTM == rite the manual?
 
@DaveRandom whatever that means, but it sounds so like "condition green" foobar, perfect for shipping.
I will start to use it.
@DaveRandom RTM = Ready To Merge.
RTFM = Read The Fantastic Manual.
 
its funny how many people know that term given how few things bother to WTFM
 
Actually I didn't know about the acronym WTFM until relatively recently.
But RTFM is kind of a classic?
Any clue what LB could stand for? It was used in context of XSS. Some kind of attack form?
 
I actually don't think I have ever seen WTFM though I was also obviously far from the first to come up with it
@hakre you got more context?
like the actual sentence it appeared in
Large Bananas
Lincoln Blackwood
 
@DaveRandom got distracted again, let me search it up, was on SO today.
 
9:05 PM
Legal Bullshit
 
> I've tried encoding, escaping and even using LB, but nothing is working.
Legendary Bullriding?
 
sounds like it may be in the context of SQL - large BLOB?
 
Leather Boots?
 
literal... binary? seems unlikely
 
9:07 PM
I'm gonna guess at "literal bytes" and OP is just using an abbrev I have never seen
feels like someone trying to sound clever, but I am cynical af
(the meaning I would infer from that is \xHH sequences)
 
literal bytes. perhaps.
 
yeh I am <50% confident on that
 
never seen LB. I've asked the OP, but maybe never gives answer. lets see.
 
I am 100% confident the question is dumb and the answer is htmlspecialchars()
 
how I read it the user just tries to learn more how to attack this "very clever"(tm) technique of "escaping".
therfore using htmlspecialchars would ruin the question.
 
9:12 PM
yeh that's fair
there's a great question related SQL injection and Big5 somewhere which I imagine would have some relevant info
can't find it but for some reason I think maybe @ircmaxell wrote it? (a really long time ago)
 
as you write ircmxl, I think I know which answer you mean.
 
fundamentally the issue is about encoding though, it's not really about whether I can give you a concrete proof of failure, it's more that you cannot prove it will work in every case now and in the future
 
albeit my little phpstorm was so clever while I had that routine (htmlspecialchars) to offer a link to: unicode.org/reports/tr36/#Deletion_of_Noncharacters
I think this is from the PHP docs, they just put it into the stubs...
 
I don't think I have ever read that before and I think I have written stuff that doesn't work like that
brb checking some decade old bullshit code :-P
yeh some of my odd xss code is really not good...
 
9:27 PM
just add header('Content-Type: text/plain; charset=US-ASCII'); to be on the savf side ^ ^
it also solves display problem with IE 4.5 to great extend.
todays kids can read HTML themselves.
 
line breaks maybe?
 
no need to make use of browsers which have so many rendering bugs and attacks.
line breaks? who needs line breaks. user have line-wrapping on to control the perfect display on any size.
it's called responsive design, you know.
you can add a <!-- use HTML rendering mode if you prefer --> on top.
 
I was referring to the 'lb' question, it's the only thing i could think of
 
LB for line breaks, ah, yeah, maybe.
I mean never heard about that line breaks are an attack form, but it's a control character, why not.
 
LB are an attack vector when passing a raw header, although PHP defends against them.
 
9:35 PM
@MarkR right for header injection. does it also fall into XSS?
 
a redirect might
 
@Tiffany bingo @hakre ^
ty :-)
 
9:53 PM
nice. what a story, I didn't know about the other answer there.
 
@Tiffany I need to steal that.
 
if you can find a use for it, go for it :P
 
@hakre So what you really want is add(4, ?) |> vectorin(?) :-)
 
you would call that a pipeline ?
 
Take the output of one function and pass it as the input to another function. If I understand what you're doing in the first place.
You said function composition, which is exactly what the pipe operator there for.
 
10:08 PM
well if pipe as in pipeline, then I would disagree.
 
Pourquoi?
 
because pipelines are for streams.
 
Not in FP.
The pipe operator, as my RFC describes it and as it exists in F# and a few other languages, is for function composition. It has nothing to do with stream handling.
 
> Functions that operate on potentially infinite data (a stream or other codata) are known as filters, and are instead connected in a pipeline, which is analogous to function composition and can execute concurrently.
 
Analagous to. Not identical to. (Mind you, I think taking a function composition approach to stream handling in PHP would be fantastic.)
 
10:22 PM
haven't followed the conversation but ripping streams out and redo them would be great...
 
F# and Elixir both use |> for pure function composition.
 
I dunno if they mean streams like in file handles.
 
@hakre They could also be talking about functional reactive programming, which is essentially iterables taken to their logical conclusion. That model is far less common in PHP because we generally have only one input per process execution.
 
but it would be nice if there is an inline iterator that can be composed.
 
That's literally what I'm working on, but running into a lot of "meh" from the voter population. :-)
 
10:24 PM
range(0, ?) |~ multiply(?)
well you need more features. then everybody loves it.
 
If only.
 
$f = range(0, ?) |~ multiply(*, ?); foreach ($f(2,2) as $x) {echo $x, "\n";} // 2, 4
 
That... is exactly what I'm doing.
Or close to.
wiki.php.net/rfc/pipe-operator-v2 - Written largely on the assumption that partials were going to pass, which it looks like they won't. :-( But it gives you the idea.
 
you can already do it today: $f = function($a, $b) { foreach (range(0, $a) as $x) { yield $x * $b; } };
 
Once we had closures in 5.3, there's nothing FP-wise we can't do. It's just a matter of how easily and efficiently, and if it's easy and efficient enough to bother.
I have to get back to some non-tech stuff. Cheerio.
 
10:31 PM
cu
 
 
1 hour later…
11:36 PM
Hi guys any idea how to run powershell script in php exec without hanging? Also my command has list of arguments involving 10000 characters that' s why I am trying to run it from a ps1 script file?
 
IGP
@FélixAdriyelGagnon-Grenier I don't think I'll ever see a company that is actively using that framework, but I find it very interesting nonetheless. I thought the design decision to go against PSR code style recommendation was a bold one, considering how enslaved people are to conventions.
 
11:51 PM
> A one-time password is required for this Amazon delivery. On the day of delivery, we will email you a one-time password to read to the driver for delivery.
...that seems new.
 
What are they delivering to you to warrant such secrecy, nuclear detonation triggers from the Amazon WMD Store?
Do you live in an apartment block or something like that? I could see it making sense in that situation
 
It's a small monitor to use with a teleprompter.....think it might be because I've made multiple orders in a few days, which is not typical for me.
 
What did you get? I'm curious as I bought a teleprompter a few weeks ago, I use it with an ipad
 

« first day (3907 days earlier)      last day (1035 days later) »