« first day (3892 days earlier)      last day (1039 days later) » 

12:50 AM
I have installed PHP 5.4.16 on CentOS 7, but when I try to run some PHP scripts, nothing gets printed. Do I need to put something in httpd.conf?
 
1:06 AM
First, do you know if the code is free of errors? (Do you have errors turned on and visible (if on dev) or logging to a file (if on prod)?) Second, it depends on the scripts. Third, it depends on how you have Apache configured. Fourth, 5.4 is way out of date, unless you're supporting legacy code, you should be on 7.3 at minimum.
 
I thought that I installed PHP 7, but when I did 'php -v', it says 5.4.16
nvm, I will update to 7. But no, there is no error, it's a very simple script that worked on another server.
 
5.4 may be the default for Cent OS 7
 
1:53 AM
Not sure, I have downloaded php 7 again, but when I enquire the version, it's still 5.4
# php -v
PHP 5.4.16 (cli) (built: Apr  1 2020 04:07:17)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.5, Copyright (c) 1999-2015, by Zend Technologies
I have added php module to httpd.conf, still php script prints nothing.
 
 
2 hours later…
3:51 AM
@Dharman I'm not sure what I find funnier, that you were expecting this to be maintained or you discovering it isn't lol
@SaifEddinGmati Hot take, I don't think type juggling is necessarily bad, and I still believe the solution for PHP is not to make strict_types the default, but clean-up the various whacky type coercions is can do, be that the auto-vivication on false, implicit float to int, and getting truly rid of leading numeric strings as a concept, and probably dropping octal literals which are only marked with a leading 0 (and not 0o which is coming in 8.1). PHP 8 is bajillion times saner in regards to all this
 
 
4 hours later…
8:10 AM
@Crell do you mean the two Enable... checkboxes? I'm on a wide screen so I never noticed them floating over the code but I guess it can happen
 
8:23 AM
Irakliy ・ *General Issues ・ #81128
 
 
4 hours later…
12:47 PM
AlyonalHix ・ *General Issues ・ #81129
 
1:02 PM
@TelKitty this is the cli version of php, if you installed the php (v7) apache module, php -v wouldn't show.
@TelKitty you can display the version of the module with a simple php script <?php phpinfo(); , call it via the webserver to verify if your installation was successful or not. if, it will show the php version (and some more info). remove the script then and test its gone.
 
I tried 'php --version', same thing.
But the problem is solved.
Currently I am having problem running shell scripts inside php.
 
@TelKitty shure, php --version is php -v.
@TelKitty problem of the kind it works or that it doesn't work?
 
Is there any config thing I need to change, i.e. php.ini?
@hakre It doesn't work.
This page isn’t working 184.168.121.126 is currently unable to handle this request.
HTTP ERROR 500
 
it works, just gives a 500. a 500 means you have to look into server logs for more info.
 
1:53 PM
 
2:37 PM
implicit declaration of function 'fdatasync' is invalid in C99 ・ Compile Failure ・ #81130
 
Every time my domains come up for renewal, I wonder why the fuck I have so many domains, but I suck it up and pay anyway, 'cause email is a curse.
 
@Girgias this is extremely bad: 3v4l.org/fekWt and i wasted hours trying to figure out why I'm getting a type error somewhere about passing an int instead of a string to a function, even tho i don't deal with integers at all at the code location, turned out PHP is saying "huh, cool array, but this key looks a bit like a number, so i'm converting it to an int, sure it won't hurt later on" in a completely different code location.
 
2:53 PM
@Sara I think I have two. And neither are accessible because I still need to fix auto-renew for my cert (.dev TLD requires HTTPS)
 
Once upon a time I had dreams of having cool interactive websites and shit, but I don't even know how to write PHP anymore, let alone make a whole website. These days they're mostly just pointing at gmail and one ancient, unmaintained blog on google's platform somewhere.
Oh... I need to poke some rfc votes, don't I?
wiki.php.net/rfc/cachediterable TF?! CachedIterable eagerly unwinds a generator making it seekable and replayable.... Yeah mate, well done, you've invented arrays.
 
cmb
@Sara AFAIK, they cache lazily
 
3:10 PM
@Sara You're far from the only one, I spend around $200/yr on domains I will probably never use (or are just redirects to other domains).
 
morns
 
wellow
 
@SaifEddinGmati It is not "look likes a number" it is "oh this string is literally an integer, no whitespaces, no leading 0, nothing", I don't know how you never came across this before, but arrays being shit in PHP is not new
Try "01", " 1" or "15.5" as array keys and you'll have a proper string key
 
3:32 PM
@cmb The RFC explicitly states "eagerly"
If it were lazy then it wouldn't be /as/ iffy.
@Girgias I want to {star} on just the "arrays being shit in PHP is not new" part. :D
IIRC, HackLang introduced syntax like: $x = dict[]; $y = vec[]; $z = set[]; to avoid all that nonsense.
@Trowski That's roughly my annual spend as well. :(
 
@Sara Yeah, I mean I don't know how to "fix" it, other then like IMSOP said to have set(), vec() dict()
 
If introducing those, there's a Q to be answered about by-ref or by-val.
 
Without thinking, should be by value like arrays
 
for me, this case was something i can't really control, it's a http uri being parsed into a prefix map.

This issue is i was rewriting something that already works in HackLang, but wasn't working in PHP, it drove me crazy https://twitter.com/azjezz/status/1401413622476283906/photo/1

Hack did the right think by getting rid of arrays
 
Well yeah because PHP arrays are shit
3
Nothing new chief
 
3:39 PM
There has been discussion on the ML recently about how the by-val poses an obstacle to a full API the likes of JS, due to the need to fetch in write mode for every -> operation
 
Isn't that only an issue for "scalar objects"
 
See, THAT I can put a star on. Nice and concise.
 
:p
 
@Sara yea, dict[], vec[], keyset[]
keyset[] is the most useless, but nice to have in most cases.
 
Hah, I was close!
 
3:41 PM
@Girgias Yes, but I remain convinced that once scalar objects get implemented, usage of the procedural APIs will immediately begin to die out.
 
Much like in C++. I use vector and map often, but once in awhile set is the right data structure
Or rather: s/(map|set)/unordered_\1/g
 
also, keyset[] will be extremely confusing to people.

$a = keyset[];
$a[] = '4';

echo $a['4']; // '4'

$a['4'] = '4'; // Error
$a[1] = 1; // Error
$a[] = 1; // ok
echo $a[1]; // 1
 
$a['4'] shouldn't be '4' so much as true, IMO
 
@MarkR Sure I can see that, but I don't believe this should be why it becomes by-ref, I don't know about the implementation issues, or if we just need more sigil soup
 
'cause with a set, the question you answer is "Is it in the set or isn't it?"
 
3:44 PM
keyset is basically a vec of unique values that allows only strings and integers, and instead of having sequence integer keys, the keys are the values
 
End of the day though, extensions like DS give you something perfectly usable and functional. Use those.
 
IMO DS will eventually get borged into core.
 
Well, under the hood keyset is definitely not a vector, else lookup would be shit
I expect you're right about that.
If for no other reason than evidently nobody else has written a comprehensive set of data structures (afaik)
 
@Sara yea, i have no idea how it's implemented under the hood, but that's how it looks in userland
 
SPL has some, but SPL is so thoroughly covered in stank that I imagine nobody wants to use them
@SaifEddinGmati Yeah. It's fine to think of it as a vector with limitations, but if you ask me in a conference session Q&A if that's right, my reply will be: "No, but if it helps, yes."
 
3:47 PM
SPL seems to be an attempt at designing, while just doing throwing stuff at a wall
 
It was part of the "get on the Java train" misstep of the early oughts
 
Sometimes, I wonder if the PHP 4 by value semantics of objects wasn't correct
 
As I understand it, the designer went into hiding in the Swiss Alps shortly thereafter
 
May 20 at 22:00, by Danack
@SaifEddinGmati just for reference, if you're trying to make a standard library for PHP, maybe avoid drugs for a bit:
Apr 25 '15 at 1:58, by Danack
@Worf I'm not going to say that drugs are bad, I'm just going to say that some of the SPL was designed when people were discovering Mescaline, and that the results were bad.
 
I'm going to try and imagine Marcus Boerger on any recreational drugs, but I'll probably fail.
The man is.... very German.
Or was anyway. Literally not heard a peep from him in a decade
 
3:49 PM
So... looks to be all clean and professional but is secretly finding a way to provide false test results?
 
I found a handy bit of TS the other day, you can safely cast an array to a ReadOnlyArray and it won't let you access modification methods. It saved me cloning my array objects when returning them.
 
@MarkR I understood that reference.
 
@SaifEddinGmati i wish PHP would add these, but i don't want to even suggest it until generics are a thing
 
I'd settle for generics enforced by static analyser at this point. Without the need for docblocks.
 
3:57 PM
@MarkR SAME!
but honestly, since hack added reified generics, i stopped using "normal" generics
e.g:

interface Parameters {
public function get<T>(string $name): ?T;
}

$foo = $parameters->get<string>('foo'); // is it really string? even get() can't tell what type it should return.

interface Parameters {
public function get<<<__Enforceable>> reified T>(string $name): ?T;
}

$foo = $parameters->get<string>('foo'); // for sure it's string or null.
final class ParametersImpl implements Parameters {
public function get<<<__Enforceable>> reified T>(string $name): ?T {
$result = $this->data[$name] ?? null;
return $result is null ? null : $result as T;
}
}
 
I'm curious why the first cannot tell it's a string?
 
well, because the implementation cannot type check the return value against T, since T is gone at runtime
you cannot do if ($result instanceof T) { .. } if generics are removed at runtime.
 
Ah yes, I've run into that in TS.
 
hence why reified generics are always better, but, i'm okay with having only the syntax for now honestly
 
I'd say 90% of my need is in IDE / static analyser support. I know psalm can do pretty well but having to always jump to somewhere else to find out what it's meant to be is fugly.
and phpstorms support for it is piss poor. If it had language-syntax level support it would be the motivation to do it right.
 
4:05 PM
@MarkR yea, cases were you need reified generics, you can use mixed as a return type and let the consumer of the API do the type checking them selves.
so Parameter::get would return mixed, and the end user will verify the type themselves
 
 
1 hour later…
5:33 PM
@CraigFrancis RFC says draft on it
 
ohh, thanks, 2 min
And done... only read the howto a couple of times :-)
How's things btw, sounded like it was getting a bit stressful?
 
5:47 PM
Thank you for that message Joe.
 
oh I was just having a shit day, it was normally busy, but my internet went down in the middle of a meeting, and fucked up the next 24 hours ...
 
ohh, yeah, that does cause a bit of a problem.
 
it was made stressful by my isp, I rang them and they genuinely said they did not know why the internet was not working ... they did not know ...
they are so crap, but I've no other options that work ... so I have to put up with it ... 80 euros a month for 20mb down and 2-4 up ... and it's 4g, and sometimes 3g, or 2.5g ... or one sixteenth of a g ...
 
I thought you said you used to live in the UK... that's the default situation (I've yet to contact VM and have them find a problem, it just "fixes itself" a couple of hours later).
Don't you just love telecoms... it's not like you work on web-based things.
 
I did, and was a bt business customer, with two dedicated lines, and the mobile phone number of a technician ...
 
5:56 PM
I get 250 mb down and up for ~65 USD a month o_O
 
and it cost about the same, and I got 120mbps (60 each, which chris joined up with a fancy router)
 
ohh... I've tried BT as a normal customer, a couple of the others, and VM as a business... maybe BT Business with 2 lines is the answer... using 4-ish G would be worrying.
 
they're really quite good as a business customer, I literally had the mobile phone number of a guy, no switchboard or waiting ...
 
nice
my last experience, ~5 years ago, consumer side, having twisted pair being installed (no suggestion of fibre optic).
 
the internet on my phone goes faster than home internet ... but not while I'm at home, crap signal on phone ... the router only has a signal because I have an external antenna stuck in a tree
super high tech
 
6:00 PM
your own diy antenna?
 
no it's a proper 4g antenna
 
cool, and usually works, but something went wrong the other day?
 
they do not know :D
 
did you say you're in a mountain/tree sort of area?
 
it's not normally effected by environment (weather etc) ... and that's never happened before ... I wouldn't call it good, it just about works .... which compared to satellite, which hardly ever works especially if there is like wind, or rain, or it's a tuesday ...
oh and clouds, it didn't work when cloudy ...
 
6:04 PM
yep, good point
 
we had satellite when we first moved here, it sounded really cool, but turned out to be the worst connection I've ever had ...
 
I was more thinking of how mountains can upset mobile phone networks (my dad used to be a field engineer, so I learned a little bit about it, but not much).
the RTT is horrible on them, and yeah, anything getting in the way... fine for emergencies, would rather not for daily stuff.
 
well we can see mountains, I guess we're in a valley of sorts, but we're not actually on a mountain (although it is hilly) ... we're surrounded by lots of orange groves (so, flat) at the bottom of the hill, and there's nothing above us ... I think it's mostly just not a very good network ... 20mbps is the maximum they deliver to anyone (including mobile phones)
 
do you know where your nearest mast is? and presumably not many people connecting to it.
 
two to choose from, but 4g antennas are directional so we had to choose, they are about equidistant from us, so we tossed a coin ... but I did try pointing at the other one when it went down and it made no difference
 
6:11 PM
Was it showing a signal at the time (implying an issue further up the chain?)
 
yeah, couldn't pick up 4g (but that's not so odd), but had maximum 3g signal, but said "disconnected" for some reason, nothing in log ...
 
could be anything really... if it's got a signal, but won't let you or others connect, it might be the subscriber information not working, or uplink from the mast, etc.
it's annoying the logs didn't show anything (my dad had an engineering phone, where you could see lots of diagnostic info, including a car that looked like a hedgehog).
 
 
2 hours later…
8:39 PM
@Sjon Yes, the two checkboxes in the lower left. If you're not on a very wide screen they overlap with the content area and block the bottom of the output, potentially.
 
8:56 PM
Oh god, look at this crazy looking signature: php.net/manual/en/function.openssl-cms-sign.php If my phd change (github.com/php/phd/pull/38) gets accepted, then we could have this: user-images.githubusercontent.com/6057627/…
 
looks good.

one other thing that would be nice to add, is `function`/`interface`/`class`/`trait` .. etc keywords.

for example, i don't know what this is from the signature, an interface? class? trait? https://www.php.net/manual/en/class.ffi.php

these should look exactly like stubs IMHO.
 
9:13 PM
@SaifEddinGmati yep, this is what I also proposed at the very end of my last comment (only focusing on the "function" keyword though)
 
@MateKocsis and to make it even more valid, functions should end with {} and functions in interfaces should end with ;
 
@SaifEddinGmati good idea!
 
not sure if that would make it "parse-able" but, close enough
everytime i see "phpdotnet" i think of C#
 
9:35 PM
@LeviMorrison Will you have time this weekend to talk/pair on pipes and changing around the execution order?
 
 
1 hour later…
10:37 PM
@SaifEddinGmati I'm not sure I agree on having the function keyword tho
 
cmb
unsure about function; don't like trailing {}/;; maybe I'm just too used to the doc signatures, though
 
Yeah, same
 
but it's invalid code, for someone learning PHP, that is confusing why 'function' keyword is needed while the code in the documentation doesn't use it
 
I don't see the correcpondance between valid code and docs
 
people learn via the documentation, or at least that should be the case.
 
10:42 PM
We lived years with the signature for optional arguments to be in []
I've never seen anyone learn via docs
That's a myth
 
@Girgias yea, that wasn't good either
i learned rust via docs, because it makes sense.

but yes, PHP documentation is also my last option to learn about anything, but that shouldn't be the case;
 
@SaifEddinGmati I've never ever used a doc to learn how to program in a language ever
And most people are the same, you use a tutorial, which might be along side the official docs, but it is a tutorial
 
I did :) and official resources always make sense for people to learn about things
 
Yes, but I still don't see how cluttering every manual page with a rather useless function keyword is actually useful
 
then what is the point of documentation if it's not for people to learn from? stubs? these are available in IDEA/editor and usually more accessible.
 
10:46 PM
Maybe if I see a screenshot I'll change my mind, but it seems to be a waste of space
 
this:

final Foo {
getBar(): int
}

compared to:

final class Foo {
public function getBar(): int { }
}

the latter is valid code, the first seems to be pseudo code
 
I don't see how not having the function keyword has anything to do with "what is the point of docs", the point of docs IMHO is to inform how something works or how to do something, I don't care how the function is defined, I just need to know what it takes and what it returns
If I need to know how I declare a function, I'll go to the section in any manual on how to declare a function
 
@cmb I don't look at the docs too often, to me it would make sense to use as close to real code as possible (including keywords and symbols). It doesn't really matter to anyone who's familiar with PHP but I can see how beginners could get a little confused.
 
@IluTov exactly this! the documentation would show code but when i type something similar it doesn't work!
 
As a dumb 12 year who learned PHP, the docs signature never confused me
 
10:50 PM
@Girgias The thing is that you were probably not a dumb 12 year old ;)
 
@Girgias as a dumb 11 year old, it did, and i had to learn from other resources
 
I agree with the class synopsis, that it makes sense there to add the class keyword because of how it is formatted anyway
@IluTov Nah, I used to copy paste identical CSS files because it took me weeks to understand that I could just link multiple HTML pages to the same doc
 
If we use real code there are two more advantages I can think of: 1. There's no discussion on what syntax to use for new features, 2. there can never be a conflict with the doc syntax and new PHP syntax
 
also, if Foo { } syntax is used for classes, what about enums? would Foo {} also be used?
 
11:09 PM
Maybe it's just that I've been working so much on the docs and I see way more issues that need/should be fixed compared to this which is just one of the tiniest problems and we've been doing fine without it
2
Like having actually all functions/constants just exist in the docs would be a great, then fix all the functions with are undocumented
Also constant linking really is higher up the priority list
 
@Girgias Yeah it's definitely not a huge problem. But I still think small things are worth improving.
 
Sure, but I'm not sure this is an improvement, MDN docs don't use valid code to describe a function (sure it is styled differently but still), maybe if I see proper screenshots of this rendered by PhD I might change my mind
 
Yes? And I don't see the issue with PHP docs being like they are
 
> MDN docs don't use valid code to describe a function

they don't use invalid code either, but PHP does
 
11:19 PM
And I'll refer to the same point as above, I need to see a concrete render before I can have a proper opinion, because I just think it'll be a waste of space
I don't see it as code, just here's the func name and what args are
The description of how it works is below it anyway
 
well, it will basically look like a stub.

might have some time next week to implement it, but will need to get familiar with PHD
 

« first day (3892 days earlier)      last day (1039 days later) »