« first day (1654 days earlier)      last day (3298 days later) » 

1:00 PM
and "senior" is just a job title anyway
 
@Jimbo How did you imagine getting to Portsmouth from my couch?
 
@Jimbo speaking of speaking: do I see you in majorica?
@Danack google maps. It's just a bit of scrolling and zooming ;)
 
@Danack I thought PHP7 had faster-than-light travel?
@Gordon Yep, looking forward to it, although I haven't started on any talk yet... are you speaking this time? Last time was rather awkward when that guy proposed a talk on SOLID and me and you just sat there silently
 
Hi guys any magento geeks here??
 
1:02 PM
0
Q: Issue while disable the previous days, today, and tomorrow in magento date picker

next2uTo disable the previous days, today, and tomorrow in magento date picker I use the below code. var calendarSetupObject = { inputField : "datefd", ifFormat: "%Y-%m-%e %H:%M:%S", showsTime: true, button : "dbtn", ...

please take a look buddy
 
@Jimbo I cant think of anything. I always have this problem that I feel no one can be interested in "that".
 
@Santhucool Just out of interest, why are you posting someone else's question?
 
Buddy its ma collegue's problem
we r trying to sort out
But not getting :(
Any help appreciated
:(
@Danack help me if u know it buddy
 
Why are you seeking help for a non-related php issue in the php room? .o
 
user895378
morning.
 
1:08 PM
Magento is obviously php
 
morning
@Jimbo magento is the new wordpress
 
@Santhucool It's unlikely that we have anybody familiar with magento in here
 
ohhhh :(
 
@Santhucool this does not look very php to me var calendarSetupObject = {
 
its javascript
part of datepicker in magento buddy
I thought any of u guys have experience in Magento
Im so un lucky :(
 
1:11 PM
So it has nothing to do with PHP? Interesting...
 
Seems like a jQuery plugin
 
yah right
 
@Danack I just realised what I responded with made absolutely no sense. Also, we didn't finish that conversation the other day.
 
but its in built in magento
 
1:13 PM
Give it some time, not every question is answered instantly, the day is still young, unlike some people in here :O
 
@Jimbo I need to write a blog post for it - it's on my list of things to do.
 
@Santhucool You do realize that PHP and JavaScript are two different languages?
 
@Gordon My problem is that anything I put forward I feel like I'm saying it on reddit, and have to be 100% accurate in what I say unless I get a load of angry "real" programmers telling me I'm wrong
 
Yah buddy I know that
I am working on java, php and android
i know javascript is different stuff
:(
 
@Jimbo but you learn from it
unless they are wrong telling you you're wrong
 
1:16 PM
@Gordon Of course. My try/catch for that is phrase everything like it's merely my opinion, and "this is why I got to this stage" and how it's helped me. Then they can't argue with that :P
 
hello i am having undefined behaviour with mysqli. i can prepare a statement and do a select, then repeat that. however when i prepare 2 selects and excecute them, the second select will never contain data
is it possible that you can't call stmt_init() a second time before finishing a other query?
 
@Danack Seems like a winner from a UX PoV.
 
@DaveRandom something something, not everything needs to be web browser...
 
any one can help me with oauth in php ?
 
I see there's a lot of questions today here :O
 
1:21 PM
@Srinivas08 not unless you ask a question...
 
@Danack I miss the days of old, when I could walk down the street for 5 minutes and be left in peace, safe in the knowledge that the only people who knew precisely where I was were the people who could actually see me, and the only time people told me what they'd just bought from a shop is when I asked them to.
 
I am wrking on 4shared api,
there is written :
To do public calls you need only application's consumer key, but to access resources on behalf of the 4shared user, your application should be granted access.

Endpoints
Request token https://api.4shared.com/v0/oauth/initiate
Authorize token https://api.4shared.com/v0/oauth/authorize
Access token https://api.4shared.com/v0/oauth/token

How to use this to get authorised request ?
 
@Srinivas08 What have you tried, what is not working, what errors are you getting? Nobody here is going to read the docs and write some code for you unless you pay them...
 
This is api url to get file info of 4shared :
https://api.4shared.com/v0/{resource name}/{id}

This is test link :
https://api.4shared.com/v0/files/8mIU1q9_ba

The link shows 401 unauthorised, How to authorise it using ouath ?
 
@Srinivas08 read the docs?
 
1:31 PM
i got a
Fatal error: Call to a member function fetch_assoc() on a non-object on this line $rowMessageInformation = $resultMessageInformation->fetch_assoc();
 
i read them , but its unclear....
 
$resultMessageInformation = $stmtMessageInformation->get_result(); get result does returns a object
i will post the whole code:
function sendOutEmailUpdate($id)//will inform everyone who is subscribed about the placing of a message. Parameter is id of message
{
global $connection;//make connection from require usable

$stmt = $connection->stmt_init();
$stmtMessageInformation = $connection->stmt_init();
if ($stmt->prepare("SELECT Email FROM SUBSCRIPTION") && $stmtMessageInformation->prepare("SELECT Subject,Body FROM MESSAGE WHERE ID = ?")){

$stmt->execute();

$stmtMessageInformation->bind_param("i", $id);//bind parameters to query
combining stmt and stmtMessageInformation does not work. however they work seperately. anyone got any hints?
 
@jipje44 please use a pastebin like paste.jesse-obrien.ca
 
@Patrick ty that seems to be a lot cleaner: pastebin.com/gkiQAmXk
basically it are 2 selects querys who are working when seperated but not working when combined. is there some kind of limit on that which i am not aware of?
 
global $connection; .... :(
 
1:38 PM
Hi folks !
 
co-worker just came to me saying that exchange was broken, it wouldn't deliver a message to a particular email address. Asked for the email address, she said "firstname hyphen surname @domain.com" so I sent a test message, got through no problem. Went to look at her machine, she had entered firstname'surname@domain.com...
 
I've posted an question last week about class on SO and I would like to know if someone could take a quick look at it ? I'm sure it will be really fast from an external eyes, I can't find why it's not working...

-> http://stackoverflow.com/questions/29852256/class-throwing-outside-of-an-object-context-error

Thank you
 
@JonathanLafleur "in ..../wp-twilio-management/functions.php on line 15" - have you really posted the code from that file + line?
 
@Danack I've adapted the error for the right line number
 
@DaveRandom firstname hymen surname
 
1:42 PM
@JonathanLafleur ....and the right file?
 
@Danack it was line 33 but what's the point ?
 
@Jimbo I can only hope he means hyphen... or that he confused us with another chat room
 
@JonathanLafleur I don't believe you have posted the code from the actual file + line that PHP has the error.
 
@JonathanLafleur bookmark this for later and read it when you have time: dependency injection
 
@Machavity Whoops ;-)
 
1:43 PM
@JonathanLafleur The point is that somewhere you have either got a function that is not defined as a class method which makes a reference to the $this variable, or you have called a method designed to be used as an instance method statically. The code you show does neither of those things.
 
@Patrick he's a wordpress user, that's not going to be advice that he can act on.
 
@Danack ewww... But I don't see what would prevent it on his own classes? He must be instantiating them somewhere...
 
@Patrick thank's I'll read that
 
@JonathanLafleur 3v4l.org/2Zt1f and 3v4l.org/D4GEO <-- those are the only two ways it's possible to provoke that particular error (afaik).
 
hi
 
@JonathanLafleur add echo new Exception; on line 33, before the first $this reference
(and post the resulting stack trace here)
 
@DaveRandom Very handy !
I found it right away !
 
:-)
Static call, presumably
 
Yes
in another file
I was confusing two call
 
That's my major gripe with fatal errors in PHP, no (easy) stack traces
 
1:52 PM
I'll keep that ! echo new Exception; ;D
That's magic ;)
 
__toString(), so literally magic :-P
 
Good morning
 
Good morning @ircmaxell
 
Good Morning .......
 
1:59 PM
Good morning
 
posted on April 27, 2015 by kbironneau

/* by Jorpheus */

 
@rdlowrey I emailed you a new password; let me know if it works.
 
user895378
@LeviMorrison I saw that, thanks Haven't tried yet. Will do shortly.
 
2:06 PM
I lost my boot record and when fixing it I somehow deleted some stuff on the partition that held /.
So I remade your user but I don't know if you'll be able to log into your home directory.
(which is intact)
 
user895378
@LeviMorrison cool. It's not a big deal. Nothing important there that doesn't exist in git or somewhere else anyway.
 
user895378
@LeviMorrison can't seem to establish a connection right now. I don't have any pressing php-src work I can't do locally today so it's not a big deal. I'll try to login later tonight.
 
@rdlowrey Okay. I'll have to deal with that when I get home since that's likely a router issue.
 
user895378
may also need to tell it to start sshd on boot if you had to reinstall the OS
 
possibly that too
 
2:16 PM
Hello php ppl
 
@rdlowrey Try again.
 
user895378
@LeviMorrison login works but I get:
 
user895378
Could not chdir to home directory /home/rdlowrey: Permission denied
-bash: /home/rdlowrey/.bash_profile: Permission denied
-bash-4.3$
 
@rdlowrey Try again.
 
... this love&hate relationship with php will kill me one day...
 
user895378
2:20 PM
@LeviMorrison works fine now :)
 
how could I implement a __toInt() function on a Object that does the cool stuff that __toString() or jsonSerialize() does?
I know it is not possible... but why do we have the other stuff then...
 
@chozilla public function toInt() {} ?
 
(int)$object;
 
@chozilla It's very simple ... you just need to write an extension and implement cast_object :)
 
2:24 PM
since (string)$object and json_encode($object) magically work...
 
there's no __toInt() here
 
Let's not turn PHP into Hogwarts, please...
 
@NikiC i would love to know what to do that this goes in the normal version of php...
 
@Patrick ExPHPeliamus!
 
Speaking of Hogwarts, I've found HPMOR to be very enjoyable
 
2:27 PM
@Patrick they only teach half of the spells it seem...
@iroegbu you can do it with (int) (string) $object, but that feels so very very ugly.
 
@chozilla is (int) $foo really better than $foo->toInt() ?
 
^^ best option... don't try what you are thinking 3v4l.org/eAq5R
 
@Patrick depends on a lot of factors
 
I kinda wish we had until because I hate negating stuff.
do { } until ($something);
 
2:42 PM
I also want when and unless
 
$expression unless $expression ?
 
@Patrick The question is more, is $foo + bar better than $foo->toInt() + $bar - I'm inclined to think that yes, it is. Not least because the type of $foo no longer matters if the former is valid - and while operator overloading would be a better solution to that, I'd accept __toNumber() or similar.
 
@DanLugg unless being just if (!condition) {}
 
@iroegbu well it ugly-works 3v4l.org/5todL
 
master has anonymous classes, thanks @NikiC, and @philsturgeon
 
2:48 PM
just use $mysql_connect for all your needs
and youre good to go
 
 
@DanLugg please no
 
@Worf, there is already a invoke on the class. and beside its even more ugly because you dont know what to expect at all.
 
unless is basically a "fuck you" to the reader, IMO
 
Could you imagine a post-fix block?
 
2:51 PM
"That huge block of code you just read? Yeh, not going to get executed."
2
 
@DaveRandom agree
 
{
    // 800 lines of code
} unless ($arbitraryExpression);
 
so you no longer have to look at the "while" before the function you have to check the bottom of the file as well to find any "unless" there...
lets combine it!
 
while ($x) { } unless ($y);
while ($x) { } unless ($y) do { }
 
PHP would be so much "better" if every functionality ever requested where implemented in the next minor version.
 
2:55 PM
With no regard for BC
An open pot, and anyone's a chef
 
@DaveRandom I meant as in unless (condition) {}
 
@FlorianMargaine so literally the only difference is saving a single ! and possibly a pair of ()?
 
@ircmaxell yup
 
-1
 
well, and actually having a clearer intent
 
2:59 PM
Disagree on the clarity element as well, tbh
 
unless (!$foo) {}
 
if (!!!!!!!!!!!!!!mt_rand(0, 1)) { }
 
Do you think it's a good idea to call data transformation lib 'transie?'
2
 
if (!bar()) { ... }
unless (bar()) { ... }
 
that reads better to me ^
 
3:01 PM
I like the first better
 
but that's because I'm used to other languages having that, too
 
not only is it shorter (who cares though), but it's also consistent with every other language
 
$value = eval(sprintf('return %strue', str_repeat('!', mt_rand())));
 
"every other C-like language", you mean
 
Every other non-hipster language
 
3:03 PM
Wow, so perl is actually a hipster language? Who knew.
:-P
 
statement modifiers are idiotic
there, I said it
 
If you need to negate an expression, you're doing it wrong.
 
I don't know about that
 
function notBar() {
    return !bar();
}

if (notBar()) {}
 
eih
 
3:06 PM
@DanLugg If not you need to not negate an expression, you're not doing it not wrong.
 
how do i write code here?
 
@chozilla please don't
unless (count($lines) < $arbitraryNumber)
 
@Patrick but i have so much to give >_<
like...
switch(false) {}
 
Hi Room11
 
Hi #924016
 
3:25 PM
morning :3
 
Does anyone understand returning by references, and/or able to point out why the behaviour is different: behaves as expected 3v4l.org/IY2J1 , behaves differently 3v4l.org/lLUI6
 
stop using references, they are evul
the first looks like a bug tbh
 
@Danack $arary?
 
all php7 bugs are caused by references
5
 
@Danack in line 18 you write ¢arary
 
3:32 PM
@DaveRandom winnar!
 
but still - don't use references :p
 
@AlmaDo why not? I like them...
 
Under certain circumstances code will be ugly if you don't use references…
 
@chozilla because you force PHP to remove optimization. Copy-on-write is smarter than you think about it
at least in PHP
Thus, in almost all cases you don't need it
 
@AlmaDo which optimization is removed there?!
 
3:36 PM
i was under the impression that you do not slow your code when you save a copy and put a pointer... how is it slower then?
 
@bwoebi hm. might be "optimization" isn't a good term here
 
@AlmaDo This is a case where using a reference allows the optimization to happen...
$data = &$session->getData();
$data['foo'] = 'bar';
vs
$data = $session->getData();
$data['foo'] = 'bar';
$session->setData($data);
 
I will go second way
Reason: even if it is same (yes, you are correct, this is the case when references are not evil ( unlike in foreach, for example), it is just - more readable
 
i will not write array syntax at all there. this should be defined values that can be set.
 
3:37 PM
@ircmaxell The most legitimate use case for references is recursive Closures.
 
@Danack just make getData() return an object that implements ArrayAccess that would write your changes to the destination
 
@bwoebi ok. antoher?
 
@nikita2206 @Danack this
Object pointer semantics > reference semantics
 
I used references when I was in need to implement recursive methods, which should pass some state to their text calls. The choice there is statics vs references, so I've chosen lesser "evil"
but it is similar to closures recursives
 
@ircmaxell Accessing private properties. [like via a bound Closure which returns a reference to a property]
 
3:40 PM
@bwoebi why in the Earth to access private properties like that?
 
@nikita2206 Maybe. Using something with a method named 'offsetSet' rustles my jimmies though.
 
@bwoebi ummmm
 
@AlmaDo encapsulation.
 
@AlmaDo you could simply give the function a use($myglobalthing) on the way >_<
 
@bwoebi E_WHAT ?
 
3:41 PM
@Danack I would go with option nr 2 ... will make for easier debugging
otherwise, how would you in the first scenarion track where the value gets changed ?
 
@AlmaDo @ircmaxell You don't want the property to be accessed or manipulated externally, but e.g. you have a Connection and a Result class. You need to update the Result each time new data comes in (in Connection class), but you don't want to expose public methods to access it.
 
@bwoebi design whole thing properly, e.g. observer?
anyway, got to go
(:
 
@AlmaDo not sure how this would solve it.
 
@bwoebi I still fail to see how a reference solves that problem at all, yet alone in a good way
 
@Fabor boss got jealous of strawbs, ordered 15 boxes \o/
 
3:45 PM
@ircmaxell Well, you could either have private methods or private properties. If you prefer the latter, you need a reference [e.g. to assign it]
 
@DaveRandom LOL. Oh man. You can use them to refill yours.
The strawbs are a slippery slope.
 
@bwoebi example please
 
@Fabor Might have to order some gold bears
 
Bears were never really my thing, though you can make great vodka jelly bears from them apparently.
Strawbs -> Jelly Beans
 
3:50 PM
Not on board with jelly beans personally
 
@bwoebi completely un-necessary. You use that variable once, you could just as easily have a method to decrement and return...
 
/me goes to investigate starmix possibilities
 
This is how I feel about everyone who complains about software that can't be updated to 7.0:
> If you can't afford to update an application then you need to
seriously think about that since that application apparently isn't
valuable enough for you to maintain it.
 
@ircmaxell As said, "Well, you could either have private methods or private properties". It's just a way how to do it.
 
> The vulnerability bears a similarity to the one reported by Cedric Van Bockhaven in 2014 (patched this week, after 14 months)
 
3:52 PM
It's not better and not worse than the other variant.
 
Can anyone here tell me how many "Code optimization" or "OP-Code optimization" i will miss when I excessively use Closures?
 
@LeviMorrison I don't get why part of the PHP community thinks major release === no BC breaks
 
@chozilla don't worry about it
@bwoebi I consider any solution using references to be demonstrably worse than other solutions, simply due to the hidden coupling it creates
 
@LeviMorrison That is probably true for a lot of people who don't have an in-house development team. If they bought an 'off the shelf' application from somewhere, and then had a small piece of customisation work done, the price to upgrade it is probably equivalent to the price they paid to acquire it.
 
@ircmaxell directly accessing private methods is also hidden coupling.
 
3:56 PM
... never expose your privates!
 
Except to your 'friends'.
 
@bwoebi which is why you shouldn't do that either
 
@ircmaxell I think the clean solution would be to actually have some value object shared by both classes… You're right…
 
@Danack Odd.
 
@LeviMorrison i can't speeel.
26 mins ago, by DaveRandom
@Danack $arary?
 
3:58 PM
> arary
This is one reason undefined variables shouldn't be allowed with [].
(in my opinion)
(this is almost always a bug)
 
/needs to learn to "see hoof prints, think horses not zebra".
 
@Danack select() isn't broken
 
Er, pardon?
 
Anyone done much work with WLAN and RADIUS auth? Specifically, anyone encountered issues with instability on Apple devices but fine with Android/Win/*nix?
 
4:03 PM
morning
 
@ircmaxell btw, ::class for $foo::class would reduce overhead by a lot in some cases
due to get_class() being a function
 
if you're calling it enough times for that overhead to become measurable, you're doing something horribly wrong
 
Nah, just normal data mapper operations, sadly
also event listeners, command buses, etc
 
posted on April 27, 2015 by kbironneau

/* by JoLabrycol */

 
@Ocramius hence the cost is trivial enough to not really even mention
especially since we could theoretically do the same thing we did with get_class there, by turning it into an opcode
 
4:12 PM
I wish I had written a RFC for $y = 2; $closure = $x ~> $x + $y;
(for PHP 7)
 
the RFC is easy, the implementation is hard
 
I generally have much more pain writing a nice RFC than an implementation… :x
But. hm. I actually have nothing special to do… so… let me toy a bit with it :-D
 
the implementation in this case is hard because they need to be the same variable (not copy-on-write changed)
 
@ircmaxell just share the symtable (like include and eval do)
I just need an exception for the function params
 
well... don't forget about scope (what if the symtable is gc'd)
 
4:17 PM
@ircmaxell the symtable is a hashtable and is refcounted
 
closures don't ahve the same lifetime as the parent scope. Not like include/require
 
I just wonder whether I should backup the possibly existing variables which are named like function params, overwrite them or error out…
@ircmaxell as said, the HashTable is refcounted, so not an issue.
 
good luck with that ;-)
 
1 min ago, by bwoebi
I just wonder whether I should backup the possibly existing variables which are named like function params, overwrite them or error out…
the easiest should be overwriting…
 
@bwoebi I realise that at least in part it's because of what I'm used to, but having parentheses and curly brackets adds to the legibility, particularly when types are defined for the params.
 
4:23 PM
@Danack Yes, when having typed or a param count not equal to 1, I will require parens.
(and not only because that, but also because shift&reduce conflicts)
 
@ircmaxell nope, it's a lot, actually
 
And having two equivalent ways of doing something in a language, is worse than having one way.
(So long as they're reasonably the same difficulty to read/write).
 
@Danack It's just optional parens for 1 param
Like ($a) == $a
 
@bwoebi eek
 
4:35 PM
@NikiC uh what?
 
@bwoebi sharing symtable
 
yeah, why?
 
analyze variable usage instead
And don't care about varvars and such crap
 
@NikiC rejected :-D
 
Anyone knows how to handle missing routes in laravel 5?
 
4:48 PM
@BenBeri I googled "laravel missing routes", first result: laracasts.com/discuss/channels/general-discussion/…
 
@nikita2206 Doing $data['foo'][] = 'bar'; with an ArrayAccess object gives the error "Indirect modification of overloaded element of DataContainer has no effect". Is there a sensible way around that, which maintains the same syntax as normal array access?
@Worf It does look like it. Open a bug?
 
Anonymous
is it possible to get a variable name inside a function, if that variable is passed as an argument?
 
@samaYo why would you want to do that?
 
@Danack i'll pass. i'm a wfx magnet
 
Anonymous
ah, the most famous euphemism for I don't know how it works
 
4:54 PM
@Danack i would love a solution for that too
 
should this 3v4l.org/g0Fq0 generate a warning? // on L5
 
@FlorianMargaine Yes I found it an hour ago.. im struggling in finding what app\Exceptions\handler is.. because I don't have it and I downloaded the latest laravel with composer
 
Anonymous
function foo($a){
	echo $a; //bar
}

foo($bar)
 
Anonymous
@Danack In case if you didn't understand the question.
 

« first day (1654 days earlier)      last day (3298 days later) »