« first day (1717 days earlier)      last day (3228 days later) » 

12:02 AM
@bwoebi I don't care that much. Pick whatever is most consistent with other messages.
@samaYo No – saying mixed is a lot more open than saying array | Traversable.
@cspray No, not yet. It won't land for PHP 7.0 so it's not a high priority at the moment. I am hoping to get credit towards graduation for implementing it. I need to go pressure the undergraduate committee for that.
I expect to implement and propose it either later this year or early next year.
 
@LeviMorrison I'm okay that you wait until end of year (until PHP 7 is out), but I wish to have the type RFCs done as quickly as possible … else we end up like this time with a blocking RFC (the scalar types one) and no other related type RFCs which may depend on yours pass because feature freeze.
 
12:49 AM
frame #0: Websocket->onOpen(clientId=115, handshakeData=null) at /Users/Bob/Aerys/test.php:18
frame #1: Aerys\Websocket\Rfc6455Endpoint->tryAppOnOpen(clientId=115, onHandshakeResult=null) at /Users/Bob/Aerys/lib/Websocket/Rfc6455Endpoint.php:209
 => Generator->current() (internal function)
frame #2: Amp\__coroutineAdvance(cs=stdClass) at /Users/Bob/Aerys/vendor/amphp/amp/lib/functions.php:562
frame #3: Amp\resolve(generator=Generator, reactor=Amp\NativeReactor) at /Users/Bob/Aerys/vendor/amphp/amp/lib/functions.php:555
I think that now looks much better than pastebin.com/raw.php?i=JSeqkzr5 … hehe… :-D
 
 
2 hours later…
2:30 AM
put this into console:
x=document.createElement(atob("aDE="));x.innerText=atob("Tk9UIEZVTk5Z");x.style.color=atob("cmVk");x.style[atob("Zm9udFNpemU=")]="120px";x.style[atob("cG9zaXRpb24=")]="fixed";x.style.top="40%";x.style.left="40%";x.style[atob("dGV4dEFsaWdu")]="center";x.style.zIndex=99999;document.body.appendChild(x);setInterval(function(){x.style.display=x.style.display===atob("YmxvY2s=")?"none":atob("YmxvY2s=")},500);
 
atob -.-
 
@bwoebi what?
 
@php_purest resolve all these atob() calls first before anyone can read your code…
 
why?
 
can you translate base64 in your head? I can't.
 
2:34 AM
i can with a calculator, or keyboard, and binary chart
 
ha.ha.
point missed.
 
does that work for you?
guess not
 
@php_purest you wish
 
what?
 
Tk9UIEZVTk5ZIElOREVFRA==
 
2:47 AM
hehe
 
Tm90IGF0IGFsbC4uLg==
TGV0J3MgY29udGludWUgdGhpcyBjb252ZXJzYXRpb24gaW4gYmFzZTY0IGFuZCBzZWUgaWYgcGhwX3B1‌​cmVzdCBjYW4gZmlndXJlIGl0IG91dC4=
 
@Sherif what is that?
 
DJ5xVTWyL2S1p2Htoz9loJSfVTWup2H2AS9yozAiMTHtnKZtoz90VTIho3IanP4hYt==
 
U28gZmFyIHRoZSBwcm9zcGVjdCBzZWVtcyBwcm9taXNpbmcgOik=
 
YWhhaGFoYWhhaGFoYWhhaA==
 
2:49 AM
@bwoebi SGV5LCBub3cuIE5vIFVURjggaW4gYmFzZTY0IQ==
 
@Sherif ITuypzHtnKZtoz90VSIHEv04VTyhqz9fqzIxYv4hVTc1p3Dtoz90VT9hoUxtLzSmMGL0K2IhL29xMFN7‌​YHD=
 
@bwoebi WW91IGhheiBicm9rZW4gZW5jb2RpbmcgdGhlcmU=
 
@Sherif SSBjYW4gYXNzdXJlIHlvdSwgaXQncyBub3QgVVRGLTguLi4gaXQncyBiYXNlNjQsIGJ1dCBhIGJpdCAu‌​Li4gbW9kaWZpZWQu
 
@bwoebi You're using PHP aren't you :)
 
@Sherif yes, why?
 
2:53 AM
javascript doesn't decode PHP's base64
padding
 
that's not the issue?
o_O
 
Ahh, I see what you did there :)
clever
 
hehe
does it now make sense? :-D
 
doubly encoded?
can't decode it :P
 
(hehe)
 
2:56 AM
i don't care enough to keep trying :D
 
@RonaldUlyssesSwanson hint:
there exists some rotative and self-reversible function
 
try it.
 
And because normal base64_encode is not enough... :D
 
exactly
It was a bit fun when @Sherif complained about UTF-8… totally didn't realize that normal decoding would end up in UTF-8, lol
 
@bwoebi Yea, I figured it out when I realized it was all basically just extended ascii flipped then I put two and two together.
Happy coincidence.
 
@Sherif I'm a bit impressed that you figured out ;-) Yeah, it was simple, but nevertheless.
so… I call you clever too :-)
 
Yea, well you spend enough time analyzing HTTP response headers and what stupid people put in their cookies and you eventually get all kinds of encoding engraved on the brain.
 
@Sherif ahaha, seriously.
Usually it's just a simple base64
 
Doing deep packet analysis on my honey pot wireless access point is always fun too.
 
3:05 AM
I've seen once someone putting a whole mysql query in a cookie…
9
 
@bwoebi ahahahha
 
@bwoebi wow, I thought I'd seen it all, but that one definitely tops them all.
 
(well, base64 encoded, but… =)
 
oh, yeah once it's base64 encoded no one can ever read it. Obviously this guy was a genius!
 
i used to work with a guy that instead of developing a gui for CRUD operations (delete, edit, etc) put a <textarea> with a link to a SQL tutorial @bwoebi :D
 
3:08 AM
Well, if you need a gui for crud you're already below amateur
 
totally. Someone should now really do it… put a mysql query in a cookie and then serverside parse the query and extract the real cookie from the query then. And watch people trying sql injections… (à la SELECT * FROM sessions WHERE id='some_hex_hash' and then when the query doesn't match, you display weird and misleading mysql errors.)
 
A trained monkey is not nearly as smart as a cat
cats have programmed your internets
 
hehe
 
When the cat is trying to tell you to "stop typing and get away from the keyboard!"
 
3:54 AM
Ask Google now "why are fire trucks red"
2
 
4:08 AM
@ircmaxell ahahahah
 
5:03 AM
How do you guys remember how a page works, what's it's responsibility, what is the process to do the job, etc? I don't want to use comments for that anymore. It's messy. Is there a better way to do that?
 
5:15 AM
why does calling a instance method statically work? I just assumed it would throw an error or at least a warning. Example
 
@Trowski how about allowing Throwable to be extended?

interface MyException extends Throwable{
    function getOrigin() : TargetableElement;
}

class MyExc extends Exception implements MyException{
   // ...
}
 
@RonaldUlyssesSwanson That is already possible.
 
In fact I added such an example to my blog post: trowski.com/2015/06/24/throwable-exceptions-and-errors-in-php7
 
was thinking it's not really useful tho :P since it doesn't say if it's an error or an exception
 
5:30 AM
Moanings
 
Yeah, I was rolling that around in my head. How should I build package-specific exceptions? Seems like I should be avoiding a package-specific throwable, and just keep it to package specific exceptions, since Error instances really shouldn't be caught.
 
another sign that we should have had just Error and Exception extends Error
with no interfaces
still feeling hurt for that @Trowski php will never change
 
@RonaldUlyssesSwanson That I disagree with.
 
it's not a single's mistake. it's the trend of taking decisions too prematurely
@Trowski yeah i know what you think of that :P
 
@Ocramius Morning. Very much evening for me.
@RonaldUlyssesSwanson I'm just thinking that usually you want to be catching package-specific exceptions. If there's not a reason to catch Errors, then making package-specific Errors seems a little pointless.
Something I'm going to have to think about a bit...
 
5:37 AM
Errors shouldn't be caught, but that doesn't mean you can't
 
Right, but it's more for cleanup and logging, not so much for handling at runtime, so for the most part you'll be seeing a lot of catch (Error $e) wrapping an app. Having the package-specific interface extend Throwable may not be ideal because then you really shouldn't catch on the interface.
 
morning
 
@Ocramius Hmm... thank you. Morning then :)
 
is there an easy (without iterating over) way to determine if an array is a list (with contiguous indexes starting from 0) rather than a dictionary?
 
5:56 AM
@RonaldUlyssesSwanson array_values($array) === $array, though iteration might be faster.
Another option is array_keys($array) === range(0, count($array) - 1), since the first option will compare values in the array, which might be expensive.
 
array_keys($array) === range(0, count($array) - 1) is a good idea
 
Requires building two temporary arrays for something that might have been solved with a simple isset($array[0]) :)
 
what do you mean?
 
array_keys($array) will build an array of the keys in the original array and range(0, count($array) - 1) will build an another array, both of which will be thrown away after the comparison.
Depending on how big the original array is, that's a lot of memory to do something that might be better solved with iteration.
 
but i have no control on that. i can't just test isset($arr[0])
 
6:07 AM
But you could make a function like this:
$count = count($array);
for ($i = 0; $i < $count; ++$i) {
    if (!isset($array[$i]) return false;
}
return true;
 
yes, that would be great
but with array_key_exists :P
good one +1
 
My guess is if you actually believe you need to do that you probably did something very wrong.
 
> i have no control on that
i'm making a library :P
 
You have no control over the code you write?
That just tells me you're not very good at writing libraries.
 
I agree, @Sherif has a point. I've never had to write code to check if the keys in my array were sequential.
 
6:12 AM
There is likely a much better way to accomplish whatever it is you're trying to accomplish. There's no sane reason why you'd care if an array in PHP is made up of contiguous integer keys or note.
 
i'm doing nasty things, yes
it's fun stuff, primarily
 
Good you've come to admit the truth.
 
Also note that if you just want an array with sequential keys from an arbitrary array, array_values($array) will work.
 
never tried to hide it
 
>> i have no control on that
> i'm making a library :P
 
6:15 AM
a library that others can even think to use (if they are mad enough, clearly)
 
lol... alright... scratches head
 
... and people wonder why PHP has such a bad name
 
@Sherif i could seriously feel offended by that
 
Hello Guys
I am a newbie in my sql
 
6:17 AM
since it's something i repeat all the time :P
 
can anyone tell a switch case can contain a select statement or not?
 
@RonaldUlyssesSwanson Why? By your own admission you're doing something nasty.
 
in mysql
 
@Mohit Have you tried reading the manual? dev.mysql.com/doc/refman/5.0/en/case.html
 
Actually i am a .NET Developer and always worked on MS Sql Sever and Oracle
and i thought same thing will work on mysql
 
6:19 AM
@Sherif it's still fun stuff. i'm not going to make a wordpress out of it, don't worry
 
but things seems to be pretty different here
so i thought it would be better to take an expert advice
 
@Mohit What did you do when you wanted to do something in MS SQL that you didn't know how to do?
 
In that Manual they are selecting just a single variable
 
My god.. i go away for 10 minutes..
 
function lol(array $x){
   for($i=0;$i<count($x);$i++){
       echo $x[$i];
   }
}
lol([1=>1]); // owned
 
6:20 AM
I want to select whole data like select all the data of a particular column
is there any data type for variable which could fit
like some list type variable
 
@Mohit I'd start by reading the manual I pointed you to. It fully answers your question.
 
OK I read it now and revert if needed help
@Sherif It is not answering my question.
 
Sure it is.
 
or requirement
 
You're just not reading carefully.
> The CASE statement for stored programs implements a complex conditional construct.

Note
There is also a CASE expression, which differs from the CASE statement described here. See Section 12.4, “Control Flow Functions”. The CASE statement cannot have an ELSE NULL clause, and it is terminated with END CASE instead of END.
 
6:26 AM
Are you saying i should implement a case expression?
but i think i had written the same structure
 
No, I'm not saying that at all. I was just pointing you to the part of the manual that explains how CASE statements and expressions work in MySQL.
 
let me give you pastie
here it is @Sherif
 
@Mohit OK, not sure what your question is at this point. But thanks for sharing.
 
Actually i have two tables where in One i am having the documents required for a particular post. and in another I am having the list of documents which employee had given. I want to get those documents which are not submitted.
so here actually i am in between of my query if the employee type is of 'P' then select all the documents (actually i should have also implement a where of p type but still it is a multivalue result).
 
21
Q: compare differences between two tables in mysql

echoblazeSame as oracle diff: how to compare two tables? except in mysql. Suppose I have two tables, t1 and t2 which are identical in layout but which may contain different data. What's the best way to diff these two tables? To be more precise, I'm trying to figure out a simple SQL query that ...

If your intention is to simply JOIN the two by primary key and get those PKs which aren't in the JOIN you could probably resolve to a simpler MINUS
In case you're looking for the optimized query it'd be something along the lines of SELECT DISTINCT a.id FROM a LEFT JOIN b USING (id) WHERE b.id IS NULL
That gives you all the PK records which exist in table a that do not exist in table b.
distinctly of course
So you gotta be careful what you join on.
MySQL can silently do some pretty silly shit and not bother to fail where set theory would.
 
6:46 AM
guys iam getting an undefined variable total in tour.php file...Please look at the file from the link provided... gist.github.com/ramlila/169bfcbfb70ba57c6a3e
 
@user12688 Why? PHP telling you what file and line number the undefined variable occurred on isn't enough information for you to look at it yourself?
 
in tour.php the code line like this: $_SESSION['total']+=$total;
@sherif line no 10
 
Great, you've read the line of code PHP pointed you to. Now all you have to do is read the rest of the information it gave you in the error message more carefully.
You're half way there.
 
WOW THERES A ROOM CHAT FOR PHP USER...
THIS IS AWESOME
 
morning all
 
6:53 AM
its more like afternoon here
 
morning
 
there is no such thing as afternoon @choz
 
sorry, i guess its morning then..
 
why won't afternoon be included in UGT?
 
6:56 AM
@Sherif ...there is a function call as textHint in home.php which redirect to tour.php from a onchange event ...If i click ok for continuous tour the error message appears as " Undefined index: total in C:\wamp\www\tpc_new\tour.php on line 32" here its line 10..Please take a look ...I hope you understand the working..
 
what is there to understand, the problem is spelled out in the error message ...
or in the first three words of it ...
 
@user12688 My understanding isn't the problem here. I'm trying to help you understand. Read the error message very carefully. It's not telling you that the variable $total is undefined.
Once that sinks in you're already on your way to debugging this problem :)
 
So, i'm struggling to design a laravel relation. I know how to do it in database but I find it hard to translate it to laravel construction codes.

The first part is simple. I have cars and regions. They are linked together with a manytomany link. But I also have have a table prices, and they can only be linked to a single region/car combo. What would be the best way to approach this? Does anyone know some documentation I could read up to when designing this kind of relation?

A car can have multiple regions and prices. A region can have multiple cars. A price can have only one region and o
 
@Sherif ok let me check ...
 
7:05 AM
@MichaelDibbets You really should learn 3NF. Your relationships are all wrong.
 
Third Normal Form
 
heads to google
 
@MichaelDibbets Here are some quick videos to get you started youtube.com/playlist?list=PLQ9AAKW8HuJ5m0rmHKL88ZyjOIKejvrj0
 
I dont do videos
I do text
you cant speedread videos
 
7:08 AM
@Sherif when i defined $_SESSION['total']=""; in tour.php the error disappears but iam not getting the correct value in print.php page
 
Don't think of it in terms of how many ways the relationships go. Instead, think of it like this; a table describes a thing or part of a thing (entity); the columns of that table describe the attributes of that thing. So region clearly does not describe a car or any part of a car. Clearly a price also does not describe a region or any part of a region.
So that relationship is obviously riddled with logical inconsistencies.
@MichaelDibbets Well, those videos explain this: en.wikipedia.org/wiki/Third_normal_form in less than 10 minutes and in a much easier to digest manner.
But suite yourself.
@user12688 Perhaps it has something to do with the fact that you assigned an empty string to it?
 
@Sherif any suggestions to handle that..
 
@user12688 The general rule of thumb for initialization is initialize all; initialize early. In your case early is when the session is first started. e.g. session_start(); if (!isset($_SESSION['total'])) { $_SESSION['total'] = 0; } Take all of the variables you expect to use throughout a session and make sure you initialize them first when the session is started and that way you don't have to go doing it in every state of the finite machine.
Just like you typically initialize local variables for your function at the top of the function, you want to initialize session variables for your session when the session is first started, or at the point-of-entry for that state.
 
7:26 AM
@Sherif Thanks dude you saved lot of time for me....
 
7:44 AM
 
7:59 AM
Morning
 
Morning
 
morning
 
morning
 
morning
 
morning
 
8:18 AM
morning
 
@Jimbo so you have completed cycle .. .congratulation :P
 
morning
 
morning
 
8:41 AM
Do you guys auto downvote any question that is answered with mysql_ driver, or how to do you go about it?
 
we know about mysql_ driver by it's smell
Good morning
 
Anonymous
Morning o/
 
@Leri long time no see. How it goes?
 
Nice feature @Patrick
 
wow... thanks for the link
I really have to do some more work on the tutorial after summer is over =)
 
8:50 AM
@SiimKallari downvote questions with mysql_ driver? no. answers with it? yes
 
It's sad to see the top comment on reddit though
 
ugh
 
Yes @JaakKütt Thats what I meant.
 
hello
 
@AlmaDo Pretty well, having lots of work, so I find it hard to hang out here
How're you?
 
9:04 AM
@Leri you're still not in Europe? I'm fine, working much, but I think for greater success in future
 
@AlmaDo No, I am getting BS. I am actually having final exams now. Will be thinking to relocate in Autumn. Whereabouts are you now? Still Germany?
 
Hi, using PDO do I need a parameter of * (all) when using the DELETE query? Example: DELETE * FROM or just DELETE FROM…?
 
@Leri yep, working on developing myself here. Lots of possibilities
 
Morning PHPeople.
 
@Leri mainly because in Germany it's very simplified procedure of getting residentship
my blue card is good, but I want to gain residentship at least - to be able to be almost fully free in EU
 
9:08 AM
@AlmaDo Do you know German? Because that's what keeps me back from actively considering Germany.
 
Wondering if anyone can explain the internal workings of why recursive functions aren't allowed (or don't work) with generators.
 
@Rahul DELETE means rows. *(all) means all fields. Using fields while deleting rows is useless.
 
@Leri I learn it. Better than could be in worst case, but yes - it's hard, especially for someone who has so few free time. I can communicate and understand in medium level though..
 
This seems to come to a halt: 3v4l.org/RnXak
 
19
Q: Recursive generators in PHP

Alma DoIntroduction Since version 5.5 in PHP there's such great thing as generators. I will not repeat official manual page, but they are great thing for short definition of iterators. The most-known sample is: function xrange($from, $till, $step) { if ($from>$till || $step<=0) { throw new...

 
9:09 AM
However, without the yield, it continues to run ok: 3v4l.org/YB7I3
 
@AlmaDo I see. Well, I am off to university now. Will be back later.
 
@Leri ciao
 
ehm, does the internal php webserver do something to the superglobals?
for some reasons I cannot access them when using it
 
It's ok people. I am here. Morning!
 
Anonymous
@PeeHaa o/
 
9:15 AM
\o
 
@Gordon $_SERVER is used all over the doc, so it should be fine. Not sure about $_POST/$_GET though, but it should be fine too afaik
 
@FlorianMargaine $_SERVER works, but $_GET and $_POST doesnt
 
@Gordon oh..
 
@LeeDavis What you want is yield from: 3v4l.org/tHRqg
3
 
@Gordon Works fine for me
 
9:21 AM
Cool! I just kinda figured that the next iteration would yield to the first, and not the implementation code.
Thanks @kelunik
 
hmpf
 
Hi everyone
i want to ask a question relating youtube api
 
Hi dr Nick!
 
Never seen the "yield from" syntax before
 
@LeeDavis It's new in PHP 7.
 
9:23 AM
@kelunik very nice.
thanks @rdlowrey
 
One more use case for yield from. /cc @rdlowrey @bwoebi \o/
 
Very nice. Allows me to do some really interesting things.
 
i working with youtube api everything is working fine
but i am unable to find any way to directly embed video to my player or creating a download video button :(
can i one help?
 
moin
 
9:27 AM
Morning Dave.
 
Morning Chris
(:
 
@DaveRandom Morning dick
errrr dave. Sorry typo
 
riiiiight
 
So you're calling me Dick, Dave and Typo? I think I'll go with Typo, sounds wind-swept and interesting
 
:)
 
9:30 AM
sigh when I need to use git revert --continue I already know something went very wrong from the beginning
 
git outa-my-face --the-hell
 
Shouldn't that be git-the-hell --outa-muh /face/yo?
 
^ git revert -m1 bla-bla-bla, git add, git commit, git push, {....} git revert <previous revert> is a way to success
 
@sectus Thanks!
 
user4039781
9:41 AM
anyone free?
 
No, I am married sorry.
 
user4039781
having trouble solving this stackoverflow.com/questions/31108465/…
 
user4039781
@Fabor please do look
 
@SaiKiran You can't load PHP through a javascript call like that. Look up AJAX
As someone already suggested in an answer
 
9:46 AM
@Ocramius Thanks for the birthday wishes :-)
 
When was your birthday?
 
user4039781
what do you mean @Fabor
 
@SaiKiran Your question already has an answer. A most likely correct one.
 
user4039781
no it is not working
 
user4039781
please do try
 
9:51 AM
@Fabor Sunday
 
how much, @Jimbo ?
 
@SaiKiran What's not working is your understanding of how PHP/JavaScript work. The answer is correct but you lack experience to use it. Keep trying and you'll learn something new.
@Jimbo Old fart now?
 
user4039781
Thankx
 
See... I don't get that kind of nonsense. People abbreviate words to save time. Sure, that's understandable. But misspelling "thanks" as "thankx"? Come on... Surely society hasn't devolved to this.
 
@DaveChen This is one of those cases where the people who made it possible, just weren't thinking very clearly imo. It does give a warning in current PHP 3v4l.org/RMGEc and will be removed in PHP 8 (I think).
 

« first day (1717 days earlier)      last day (3228 days later) »