« first day (2417 days earlier)      last day (2757 days later) » 

00:28
yeah this will come out really nicely
00:41
Hello
$ sapi/cli/php -r '$x = "Enum"; $x::__callStatic("", []);'

Fatal error: No. in Command line code on line 1
I like this error message. I think I will keep it.
$ sapi/cli/php -r 'enum Foo { Apples, Grapes, Parsely } var_dump(Foo::Apples());'
string(11) "Foo::Apples"
Progress!
@Andrea "No. Just don't." sounds better. … IMHO.
@bwoebi I like the brevity, though :D
@Andrea yeah, it's not verbose enough for useful debugging though.
You also need to tell what went wrong: "doing something one shouldn't".
@bwoebi no, it is
if you're trying to call Enum:: directly you're up to no good
for one thing, that's not even valid syntax :D
$ sapi/cli/php -r 'enum Foo { Apples, Grapes, Parsely } var_dump(Foo::Apples());'
object(Foo::Apples)#1 (0) {
}
$ sapi/cli/php -r 'enum Foo { Apples, Grapes, Parsely } $x = "Foo::Apples"; new $x;'

Fatal error: Uncaught Error: Call to private Enum::__construct() from invalid context in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code on line 1
$ sapi/cli/php -r 'enum Foo { Apples, Grapes, Parsely } $x = Foo::Apple();'

Fatal error: Uncaught Error: Enum has no such member Apple in Command line code:1
I've gotten somewhere.
01:09
@bwoebi how do you feel about instanceof Foo::Apples ?
@Andrea I like it, as said.
it just feels weird that Foo::Bar has a different meaning there to everywhere else
And I'd like to also have == Foo::Apples as well… but given that you use new … mhhh
@bwoebi you can do $foo === Foo::Apples() if you want
not the prettiest, but.\
if you're curious, this is what my code looks like right now: github.com/php/php-src/compare/master...hikari-no-yume:enumADTs
@Andrea and now… make the parens superfluous?
01:23
@bwoebi would require some magic :p
maybe doable though
main thing is constants aren't dynamic currently, which is annoying
@Andrea you could create a special AST node, initializing the constants upon zend_update_constant()
This might even work with opcache as opcache will also only store the AST (I believe??)
@bwoebi I think I tried to implement that once! I think I also ran into trouble. But yeah, should be doable.
anyway I'm going to try and sleep, talk to you later
good night
 
1 hour later…
02:55
Can anyone spot a vulnerability (specifically with the double operator check) in this script? pastebin.com/PsGDzuNe
Is there any way for me to throw it some garbage in the $test == $password section and it would pass?
03:09
@ScottMcGready That one is not vulnerable, with the given $password.
 
1 hour later…
04:16
@kelunik That could be useful in a variety of situations. createBodyStream could also return a Promise (not sure if that's a sensical solution there though without looking deeper).
@kelunik What's the reason for adding getBuffer() to Parser vs. using cancel()? Do you have a use-case where you're peeking at the buffer?
@tereško just out of curiosity, why did you name that file bootstrap.php? What does it mean? As far as I know, its a CSS library which is nothing to do with PHP.
04:32
@Shafizadeh The real meaning of bootstraping has nothing to do with the CSS framework ;)
!!wiki Bootstrapping
In general parlance, bootstrapping usually refers to a self-starting process that is supposed to proceed without external input. In computer technology the term (usually shortened to booting) usually refers to the process of loading the basic software into the memory of a computer after power-on or general reset, especially the operating system which will then take care of loading other software as needed. The term appears to have originated in the early 19th century United States (particularly in the phrase "pull oneself over a fence by one's bootstraps"), to mean an absurdly impossible action...
05:09
posted on May 29, 2017

New Cyanide and Happiness Comic

05:19
@Valentincognito I see thx
@Trowski Me not seeing that cancel returns the buffer.
 
1 hour later…
06:40
o/
user924016
06:57
o/
hi guys how do you check if the site is down?
using php code i've used curl but the only problem is that it doesnt check if the site is down it only check if the site domain is taken any ideas guys?
user924016
codes?
/**
* Ping site is alive
* @param domain $site
*/
function is_server_alive($site){
if($site !="") {
$header_check = @get_headers($site);
return $header_check ? true : false;
}else{
return false;
}
}
here is my code
user924016
moin
user924016
07:08
@MaryDaisySanchez I dont understand how that code couples to what you said
i have a 3 website
from different countries for example if china.test.com is down then i'll redirect it to korea.test.com if all is down i'll check which one of the server is up then i can redirect it
when i use this link <https://css-tricks.com/snippets/php/check-if-website-is-available/> my site is always online even though i have make the server down
user924016
This sounds a bit like load balancing
user924016
or service discovery
morning\
07:26
mornign
mornin
morning
moaning
moin
@kelunik love the snail in the AMPHP logo :P
07:30
is AMPHP that slow?
@Ocramius It's not the finished one. @Wes
@Gordon In terms of logo creation and v2 development, yes. ^^
@MaryDaisySanchez Hi..
@NagarajPujar please don't ping people at random. thanks.
07:48
!!rfcs
> This is a simple 50%+1 vote with yes and no options.
@kelunik ... urm ...
@JoeWatkins It is not a language change.
it requires a super majority ...
07:59
And why?
because everything does .... but in particular, it has BC implications however slim and however well mitigated, and if I understand it, it has a clause that will allow us to add (or change) constants in perpetuity ... that is an ongoing change that we must maintain ...
> We also need to ensure, as much as possible, that the decision isn't based on some arbitrary circumstances (such as a temporary marginal majority for a certain school of thought). For these reasons, a feature affecting the language itself (new syntax for example) will be considered as 'accepted' if it wins a 2/3 of the votes. Other RFCs require 50% + 1 votes to get 'accepted'.
we all seem to agree that if you change code, it's a "language change" ...
new syntax is an example of a language change ... but it doesn't mean "syntax change" ...
changing the language means changing code
vice versa
Uhm, disagree, but I'm no internals junkie
if I had noticed, I would have asked them to change it too
note that none of them relied on a slim majority ...
it's no big deal, this is a no brainer, it's going to pass whatever ... I do think it's important to have a super majority for everything actually ... and when I've time, intend to rfc that change (I started a few months ago) ...
but it's only a change in wording ... there seems to be a consensus that the wording is not precise enough ... there also seems to be the consensus that changing code means changing language and while I note your disagreement, it doesn't change apparent consensus
had any of those RFC's actually passed with a slim majority, questions would have been asked ... because history tells us that when we merge a patch with only a slim majority, it causes trouble ... the last two or three patches that got in on a slim majority caused problems ...
afk, walking dogs ...
@tereško currently I'm trying to find something similar with bonobo for linux, I want to make a git server on my own server. any suggestion?!
@JoeWatkins @Ocramius disagreed, too. If there was a consensus, then none of the RFCs would probably have a 50%+1 vote. Feel free to raise the question on internals. I'll change it if there is such a consensus.
@Shafizadeh if you dont need GUI, you can just use gitolite or even do it with git itself
I see, and if I want GUI ? :-)
08:19
Then just use gitlab
emm ... then I am not entirely sure. GitLab need a metric shit-ton of RAM :( And I am not sure what you need to set up Gogs
True, doesn't really matter though
Go buy a bunch of DIMMs - I got ~2EUR spare that I can give you
you can probably buy 8Gb with that
@Ocramius I think the server he was talking about is a VPS
Let it swap - no big loss :P
@Shafizadeh your best option would be to set up a lightweight version, that doesn't need GUI
08:22
mornin
Yah, SSH-based is usually sufficient if all you need is mirroring
otherwise use a github organisation plan - works well too
@tereško well I'm not fast enough without using GUI
what would you need the GUI for?
to make a repository for exaple
example *
$ cd /srv/git
$ mkdir project.git
$ cd project.git
$ git init --bare
Initialized empty Git repository in /srv/git/project.git/
08:27
:-) .. well I guess I will be faced with problems in future
you can try setting up GitLab or Gogs
GitLab needs at least 2GB Ram (based on its documentation)
lemme check Gogs
there is also something called GitPrep and Kallithea, and Gitea
which one is your recommendation?
no idea
08:34
I use GitLab
@brzuchal is that ok?
I use it because it has nice GUI also RWD and there are Issues, Pipelines and whole CI even CD, there are forks and issue boards, their admin panel is very simple and it can be integrated in som variety of well known web apps.
@kelunik see the discussion that was conducted when I raised it last ...
the consensus exists ...
@Shafizadeh I've got 30 developers team and can't imagine managing them without GitLab or GitHub now
we use self hosted gitlab at the company I work for, can't complain much, it's the closest thing to github
08:40
But am also not familiar with those other solutions like Gogs, etc/
github offers on-prem githubs
you can get it running on docker in like 20 minutes, CI pipeline included
on prem github is probably the fanciest system, but gitlab ce is free, hard to beat that :p
@Patrick got your message - at a client's ATM, but will reply tonight :+1:
@Ocramius thanks :)
well, yeah… GitHub Enterprise is currently $2,500 per 10 users / year
user924016
08:43
$$$
user924016
(=
@Shafizadeh if you need to store the code just for yourself, then you can also just use gitlab's hosting (it might be more stable then bitbucket): about.gitlab.com/gitlab-com
and it also give you free private repos
user924016
Is bitbucket unstables?
@RonniSkansing it seems like it has issues with reachability in Iran
user924016
ah
08:47
@RonniSkansing you would have to ask for more details to @Shafizadeh, if you are interested
Oh, Iran is involved :S
A JS developer that I agree with! :O https://github.com/moll/js-must/issues/64#issuecomment-304607212
@Ocramius TBH, Iran is not known for fucking with developers (unlike Turkey), so it might be a problem at BitBucket's end
@tereško I have a few friends from there that have constant problems in doing day-to-day standard dev work
plus good luck if you ever did anything for the porn industry...
@tereško hmm, sounds good
oh ... it's memorial day, I got a day off ...
08:54
@Ocramius well, that's theocracy for your
@brzuchal I see, yes a huge ream really need such a thing
The amount of pr0n that my work produced is enough to give me a free ban from all these nice countries :-P
Always wanted to visit Iran, but it's never gonna happen in my lifetime
@tereško what about buying a valid IP and make my local server as online git server ?
@Shafizadeh you can use a DynDNS
or expose it via ngrok
08:56
@Shafizadeh buying an IP? Isn't that already provided?
@Ocramius is that free?
@Shafizadeh yarp, you just can't pick a nice name with the free tier
but if you have a domain, you can use a CNAME DNS entry
AFK: cycling to work
@tereško I mean a valid IP. no, my current IP is local which is invalid
@JoeWatkins so, you haven't used 1st of May like all the normal people :-)
08:58
@Shafizadeh you mean a public IP?
@Ocramius you work for the porn industry?
@Ocramius does it need a public IP?
user924016
@JoeWatkins niiiice
@Shafizadeh no, it's dns
09:02
ah
09:24
What is the difference between Continuation and yielding generator? Because I don't get it :/
@Shafizadeh do you really want to put your personal computer on the internet?!
that seems like a really unhealthy idea
@Shafizadeh I think gitlab.com with it's private repo service is quite good for a start. Running self-hosted gitlab may be done in a future, for eg. on some dedicated server etc. tehy are quite cheap today, I do have my own for personal uses from for eg. soyoustart.com it's a cheaper ovh.com brnad
how can i upload and display an image
@tereško
fuck off
user924016
hah
09:31
@NagarajPujar You mean upload with form?
:D
ya @brzuchal
@tereško wish you the same..
Have you tried something already?
ha with html <input type="file" name="image"> like this @brzuchal
he has tried pinging people at random
@NagarajPujar I asked you not to ping random people. It annoys them. Now please don't do it again.
if someone can and wants to answer they will.
09:34
ok done.. sorry..@Gordon
@NagarajPujar you also neet multipart accepting <form> and move_uploaded_file function use on PHP side.
@brzuchal W3Schools should not be trusted as a reliable resource. Click here to read why. Check the official PHP Documentation for help with PHP.
can you explain in detail?? @brzuchal
@Jeeves fuck off
@brzuchal Why?
09:36
@NagarajPujar read the link above there is everything explained
@brzuchal seriously, dont link people tho that shithole
ok thank you @brzuchal
@brzuchal He is right though. That page has xss vulns
when i download my form in csv format using phpexcel it downloaded successfully as a csv format i requested but when i open that csv sheet it displays as [Read only][Compatability mode]...so how to download csv format without compatability mode
Ok, guys. THX for the info
09:45
morning guys and girls!
@tereško my brother how are you?
at work, and I am not your brother
... or I would have to ask some serious question to my parents
@tereško hahahahahahha
what if we are :O
(first open the song than read it)!!!!
1pa
1pa
Hi guys! I'm trying to make a autocomplete textbox with php, postgres, and bootstrap. But when i'm start write i'm getting this error on console "The connection used to fetch this resource was not secure" from the autocomplete.php why?
@littlepootis I did do a lot of software regarding pr0n, pr0n ads, pr0n video recording stuff
!!should I take the shrimps salad or the greek salad?
09:54
You should the greek salad.
hmm… meh
!!should I take the shrimps salad or really the greek salad?
You should take the shrimps salad.
you are so unhelpful
!!should @gordon shut up?
09:57
!!should @Ocramius shut up?
Let me think about it … wait … yes … well actually, no.
@Gordon Shrimp salat with a bit of atropine :D
@Jeeves looks like one of my responses about whether a php-src feature addition causes a BC break
@Ocramius Please tell me.
@Jeeves are you an Indian call-centre support guy?
09:59
@Ocramius I don't think so.
Hey tweeps, what is the craziest magic that you've ever seen in a #PHP project? RTs appreciated.
^ Help me, @Andrea Wan Kenobi: you're my only hope ^
@Ocramius The craziest magic is that it's able to work :)
5 messages moved to Trash
10:15
@Ocramius everything you created
obviously
RT @Ocramius: Hey tweeps, what is the craziest magic that you've ever seen in a #PHP project? RTs appreciated.
@Ocramius I think my own projects are mostly quite tame :(
@Ocramius oh wait I know, those people that emulated scalar typing by selectively ignoring type errors in PHP 5.6…
You have any idea how big the impact of your rfc is @kelunik?
Gut feeling says not much, but not sure
@PeeHaa I hope not that much negative impact. A server needs to be broken for it to fail.
10:24
@Andrea nice! But didn't you build some awesome yoloswag stuff too?
hi can anyone suggest me a provider for a webserver
@Ocramius oh yeah there was the time I improved yolophp by implementing a small lisp interpreter
@Andrea That's the stuff \o/
oh I know what you'll like, one moment.
@Ocramius what I'm currently working on as a PHP language feature is possibly also “crazy magic”. It's mostly just some boring classes. However…
wait WHAT
10:28
…it has a final class extending a final abstract class extending a final abstract class :3
I'll need a debugger for that
@Andrea yeah, we were working on that with @asgrim to get proxies working against final classes too
@Ocramius hah
stream wrapper stuff, as usual
specifically, I'm implementing Enums with final classes because I don't want userland monkeying with it
however obviously final classes aren't meant to be extended, so I tell the inheritance checker to wheesht :3
Oh, you do it at engine level
10:31
alas :<
otherwise it's just normal classes though.
maybe we should add this to reflection :3
it amuses me that Reflection includes a few things that do more than just, reflect
some parts of it are more like reaching through the mirror…
Yeh, that's why I use Closure::bind() for what isn't supposed to be done by reflection
feels more "right" in its wrongness
and I added Closure::call() for the worst hackery
which is internally a bit of a hack
I should start using that - I bumped all my libs to PHP 7.1 anyway
https://t.co/DlyIFixJTd
@Andrea I'm unable to track your nicknames: you are beating me at this game
10:37
@Ocramius somewhat intentional in this case
I was kind of fed up with @notajf and nuked it, and only carried over the followers on my non-public account
fair enuff
ooh, Closure::call has gotten more sophisticated since I wrote it
@Andrea btw, I just sent your ArrayBuffer to the print spooler
that's always fun with internals stuff. my implementations of things are usually at least competent, but then they get optimised later
@Ocramius uh
Framing it
10:39
I say “usually”. It's a wonder Closure::call() worked at all…
@Ocramius you can probably tell from the code why it is the way it is
It will take me a while
ah, well, the reasoning is that I needed to break encapsulation to get the classes to work with eachother properly
but I don't want end-users doing that
thus the… discouraging function name
I realise now I should just, uh, make an abstract base class and make this property protected…
Since protected works backwards in PHP!
nah, this is more distateful
I like it
question for @NikiC or @bwoebi probably: is doing this in a static method safe? zend_class_entry *ce_enum = Z_CE(EX(This)); (I haven't been able to break it so far.)
@Ocramius this has no real-world use right now, but this may also interest you: gist.github.com/hikari-no-yume/33cf828bfa306b1b1d2187a6de639375
@Andrea We do not allow rebinding methods (fake closures) to scopeless, so should be probably safe.
10:47
@bwoebi Neat.
@bwoebi interestingly this still isn't broken if I do $enumValue->__callStatic("", []);, I guess PHP forces This to be a class entry here
@Andrea adding it to the thread - simple/nice
@Ocramius I know right? I felt like a genius when I wrote it.
I can even explain it without having people pop their eyes out
yeah :D
Btw, if this wasn't clear, I'm just collecting material for my list of incredible elephants and where to kill them
err, find them
10:49
@Andrea yeah, because the method is static
@Ocramius this sounds like an exciting book
@bwoebi PHP used to let you do shenanigans with instance methods being static and vice-versa, but I guess we finally tamed all that?
@Andrea A bit, yes.
^^
Anyway, fun realisation in my enums dev process is that I don't actually need to implement a constructor.
all Enums descend from Enum, so Enum is in charge. Also I'm writing Zend code, so I'm like, a god. I can do all the initialisation in one function.
What's a minor god then?
@Ocramius PHP extensions? :p
they can do most of the stuff /Zend can, but not all
except for ext/opcache which is greater than even the gods
(why is OPcache still an extension?)
10:54
@Andrea they could rewrite internal function pointer linkings within the engine at loading time and wrap all the things…
@Andrea Good question … Next! [I wish it weren't…]
@bwoebi I still think it should be moved to /Zend and statically-linked, but automake scares me, so I haven't done it myself
@Andrea I think the Optimizer part should.
Not sure about the actual opcache part…
@Andrea this is a good question, PHP without it sucks!
@bwoebi Optimizer definitely, but I feel even opcache proper maybe belongs there given how deeply it's intertwined with the core
I mean there's nothing else in /ext with that sort of status
@Andrea uuuh. it isn't really deeply intertwined.
10:58
@bwoebi well… it being dynamically-linked means it has to use an API, true :p
It's rather just a layer acting on top when op arrays are loaded
fair
That's a pretty local coupling point…
hmm… if we moved Optimizer into /Zend, could we then have an experimental setting to use it without opcache…? do we already?
@Andrea yes. not yet.
11:07
hmm
if I directly access ce->static_members_table, will anyone get mad at me
…well, this is what tests are for :D
$ sapi/cli/php -r 'enum Color { Orange, Green, Purple }; var_dump($a = Color::Orange(), $b = Color::Orange(), $a === $b);'
object(Color::Orange)#1 (0) {
}
object(Color::Orange)#1 (0) {
}
bool(true)
@bwoebi ^^
wait what
PHP has static function inheritance, but not static property inheritance
hmm?
yes.
I can sort of see the logic but… ugh
$ sapi/cli/php -r 'enum Color { Orange, Green, Purple }; var_dump($a = Color::Orange(), $b = Color::Orange(), $a === $b); $rcp = (new ReflectionClass("Color::Orange"))->getProperty("instance"); $rcp->setAccessible(true); var_dump($rcp->getValue());'
object(Color::Orange)#1 (0) {
}
object(Color::Orange)#1 (0) {
}
bool(true)
object(Color::Orange)#1 (0) {
}
11:25
@kelunik kk tnx
11:43
FWIW @kelunik very old article but first hit on google jve.linuxwall.info/blog/index.php?post/TLS_Survey
Considering the starred messages here, I can see that @NikiC going to conferences is having a terrible effect on him
@Ocramius On the contrary, I think it's having a wondrous effect on him.
@tereško another thing; you recently gained your gold badge to close php questions and I had to fix quite a few of the duplicates you used, where the most important ones were missing. You should take more care in doing this. I can't keep doing this for you. — Fred -ii- 3 mins ago
:D
I especially liked the "recently" part
is there any equivalent to ZEND_CALL_ARG that would let me replace an arg?
I checked in zend_compile but there doesnt seem to be a zend_push_arg or something
i want to add values to an array param or replace it when the param is not set
11:55
The handle field in the object, resource structures lxr.room11.org/xref/php-src%407.1/Zend/zend_types.h#279 are they unique values for a particular object/res. Can that be used to identify if an object is unique or not across execute calls
Hi guys good evening
@JAamish they are unique during their lifetimes, yes.
Unserialize ArrayIterator broken – #74669
@JAamish also, how do you mean unique across calls?
making nice progress with enums
12:00
Any body plz tell me how to retrieve some data rows from database table between some range of date and the interval also included. Also only the start date and the interval in month is known
?
but gtg now… for secret things to be later revealed
:3
@bwoebi during a life time of request, I want to measure the mysqli_stmt_execute time. But the query is present in the mysqli_prepare call. So I have to store that query when I get it with the stmt's handle and was thinking of getting it back when stmt execute is called
@bwoebi I just have one concern that it is marked as "// TODO: may be removed ???". I hope that it would not be removed.
@JAamish well, as long as a reference to the handle is held, that's fine.
@JAamish It currently doesn't look like - it's a relict from phpng.
@bwoebi when you say "reference to handle", do you mean to store the address of it? I just used Z_OBJ_HANDLE_P(obj) and printed this as int and saving it as the key
12:06
@JAamish no, refcount
@kelunik cool.
@Ocramius hey, we taught him to be snarky first.
@bwoebi sorry, still did not get it. The handle is a uint32 which stores a unique int value as an id. So I can use it just as a uint32 itself, right
@JAamish sorry, I mean as long as the refcount of the object is greater than zero it's fine to rely on the handle
@bwoebi ah! got it. I shall then check if the refcount is greater than zero, and then store the handle as a uint32 itself
handle is just a unique int value right
@JAamish Umm … I mean, as long as you rely on the handle, the refcount must never drop to zero. So you need to bind to the destructor or increment the refcount yourself or such.
12:11
@kelunik @bwoebi @Trowski do you guys provide an benchmark somewhere for development on amp?
@PeeHaa Benchmark for development?
As in run benchmark -> make a change -> run benchmark again to find out the impact of changes
@bwoebi but since I'm inside the execute_internal hook, I suppose that the refcount would not be zero, as that object is being passed through.
@PeeHaa No, none that I know of, except for the one in byte-stream.
12:13
@JAamish I wouldn't rely on that…
@PeeHaa And I don't really know what such a benchmark should contain.
@bwoebi understood, I will add a check to make sure that the refcount is indeed greater than 0
@Danack you've done a fine job, sirs
@bwoebi I will refrain from incrementing myself, as I want to avoid my extension leaking memory ;)
thanks for your tips! very helpful indeed
@kelunik Not sure myself either just now. But I think it would be nice to measure changes somehow
12:18
@PeeHaa It's probably as hard to measure as PHP's realpath cache.
so ... youtube has made the phone app worse again
k - i'm being slow. There should be a link to the merge commit on this page github.com/php/php-src/pull/2082 right?
I can only see one merge for the news entry commit.
Also - apparently going back through commit histories on github is now terrible, as you can't jump pages.
@kelunik kk
12:52
Can someone please explain to me what is the difference between Closure::fromCallable and simply callable in use?
AFAIK Closures are designed to bind some variables from creation scope and/or $this variable, but callables don't need such stuff, right?

« first day (2417 days earlier)      last day (2757 days later) »