« first day (1258 days earlier)      last day (3916 days later) » 

16:04
@DavidH Are you blocked from posting questions?
@DanLugg Yes..for something of 2 months ago
@DavidH Well, then maybe step 1 should be: getting yourself unblocked.
Deleted questions I can't edit because I later found out about editing making an old question a front page question
I can't comment and i'm trying to earn rep through editing questions...
But since I'm a rookie in PHP I can't blast myself forward in rep..
Sounds like a pickle. Maybe new account and start over.
I dunno if that's good advice, but if your account is painted into a corner it might be the only option.
Yea I could but I thought I read this was IP related anyway.
Not sure if it's actually so though. I can do anything but ask questions.
16:09
Try appealing on meta. Nevermind, don't do that.
good morning
@DanLugg new avatar?
Uh, awhile ago. Actually I should change it again I... shaved off my beard.
Anyone know how to map a PhpUnit test # to a test
Say, if 263 of 365 was hanging and need to find what test that was?
16:16
@LeviMorrison runin verbose mode, and it'll tell you which test is run as it runs it
Problem is it doesn't happen on my machine, it happens on Travis ^^
Is there a way to tell travis to use verbose?
@DanLugg Update pic required.
@Fabien lol
nee-required.
16:17
Ah, just a phpunit config, duh.
Brain lapse.
@LeviMorrison add verbose="true" to the xml
Yeah, just realized that. Had a brain fart ^^
@ircmaxell Since it hangs travis just kills it.
Doubtful that it will tell me what test that is :/
@LeviMorrison verbose should dump as it runs
16:24
I get the same output with verbose on.
so when it gets killed, it should already be output
ahh, you want --debug
16:35
Thanks, that should do the trick.
Switching to PreparedStatements is even more better to ward off SQL Injection attacks !
16:52
Prepared statements can't be async (not sure if actual limitation or if just API problem).
That makes me sad :(
user895378
@LeviMorrison They can with PostgreSQL in PHP 5.6 ;)
user895378
So you know ... one could use a real database :)
user895378
I know I say this about once a month but I'm still consistently amazed by how great generators are. @NikiC is a hero!
17:13
Why is our best customer (in terms of business money) such an fucked up company who changes their mind every freaking hour??? :(
/rant (for now)
Sods law.
user924016
lol
user924016
@PeeHaa =]
@PeeHaa i thought that's how you become the customer of the year?
stackoverflow.com/a/22694548/871050 And then they ask why I don't give out good answers anymore
17:20
can I execute constructor with unspecified number of dependencies without reflection ?
well ... that's mildly disappointing
@tereško You can abstract your dependencies to a single object, but not like you describe no.
@ircmaxell Wait, can you not use $args or something?
@SecondRikudo ?
@tereško splat will allow it in 5.6...
that would require altering the constructor
17:24
@ircmaxell Can you not have something like
public function __construct() {
  $this->data = func_get_args();
}
And then pass an arbitrary number of arguments?
I was thinking more along the lines of $instance = new $class(...$dependencies);
@ircmaxell func_get_args() not $args, my bad.
@SecondRikudo as @tereško pointed out, that would require altering the constructor
@tereško 5.6
Well, how does the constructor look like initially?
17:26
His solution also requires "altering the constructor".
Unless I'm missing something here.
you are missing something
What am I missing?
you are missing what the triple-dot operator does
@tereško I know what the triple-dot operator does.
But what I probably don't understand is your problem itself.
What do you have now, what do you want to have?
my problem is all about DICs
17:28
@tereško loves DICs *giggle*
8
function makeInstance($className, array $args) {
    return new $className(/*How do I pass args here!??? */);
}
Are they hard?
;X
@ircmaxell Aha, okay, now it makes sense.
So yeah, I guess it's triple-dot for you, but you'll need to wait for 5.6
I have seen horrible piece of Yii code , which solved it, @ircmaxell
eval?
17:33
$count = count($args);
if ($count === 0){
    $instance = new $class();
} elseif($count === 1) {
    $instance = new $class($args[0]);
} elseif($count === 2) {
    $instance = new $class($args[0], $args[1]);
} elseif($count === 3) {
  // ..... etc

} elseif($count === 6) {
    $instance = new $class($args[0],$args[1],$args[2],$args[3],$args[4],$args[5]);
}
@ircmaxell something like this
and, yes, you can actually find it in Yii's core
evil eval would have been better XD
eih
return (new ReflectionClass($class))->newInstanceArgs($args);
@tereško new $class(...$args) maybe? :-) (No-one is interested in versions older than 5.6, you know ;-) )
17:35
@bwoebi 5.6 is gold? I didn't hear that
@ircmaxell as long as master is stable, why not use it? :-)
that's based on the presumption that master is stable. which we know is a lie
Do you know some critical bug actually?
anyone know about smtp servers?
17:38
@ircmaxell ah?
Yasso's session changes, for a bunch
@bwoebi sorry .. that project is launching in less then a month
I suspect that 5.6 might not be stable by that time
@ircmaxell just not use them, no problem.
Btw. are Yasuos session changes the reason why beta1 isn't tagged yet?
17:49
Just thinking out loud; is there any technical reason to forbidding arbitrary expressions as parameter defaults? Such as function f($x = 2 * 2) { }
Or is it something that was done for conformance with predictability?
hmm ... how to detect recursive dependencies
@tereško Recursive as in cyclic?
wouldn't that be the same ?
Yes, I suppose it would :-P
Stack?
@DanLugg IIRC, 5.6 changes that
17:53
class A require B and C .. but both B and C require X (this would be a valid case, for which stack would probably fail)
@tereško Tree then; and you'd have to do branch comparisons
@ircmaxell I'll have to have a look into that. I'm guessing it doesn't go too far though, and support anything like locally bound variables: $a = 2; function f ($x = 2 * $a) { }, correct?
@DanLugg no, you'd need constants here
I made work: const a = 2; function f ($x = a * 2) {}
@DanLugg that sounds like way too much work
@tereško I'm working on a dirty POC
18:02
@tereško Solved in Auryn (although not in the simplest manner).
^^ True, trying to do it ubersimple
Actually I don't know if I've tested that exact case. Will go check.
Hmm, dunno why this isn't working on travis:
class SkippingIterator extends IteratorCollectionAdapter {

    /**
     * @var int
     */
    private $n;

    function __construct(\Iterator $iterator, $n) {
        parent::__construct($iterator);
        $this->n = $n;
    }

    /**
     * @link php.net/manual/en/iterator.rewind.php
     * @return void
     */
    function rewind() {
        $this->inner->rewind();
        for ($i = 0; $i < $this->n; $i++) {
            $this->inner->next();
        }
    }

}
With $n equal to the total number of elements in the iterator.
@tereško Internalize the actual injection/instantiation and accept a stack argument: 3v4l.org/tGMQQ
@LeviMorrison LimitIterator
18:07
It just returns the graph of what would be instantiated ^^ but y'know
@bwoebi Ah, gotcha. Yes, I recall the RFC for that, didn't realize it passed through; congrats :-)
@LeviMorrison us1.php.net/manual/en/limititerator.construct.php <-- does what you are doing
Still curious though, it is technically possible (and feasible) to permit locally bound variables as defaults; it's just not done to favor simplicity, correct?
@ircmaxell Sure, but it's horribly named.
I dunno how that would work with class scope; public function f($x = $this->y) { }
It's a limiting and skipping iterator in one.
18:14
not really, behaves just iike limit in SQL
I've split it properly into skipping and limiting in Ardent.
This code works on every machine I can test.
It only happens on Travis.
lol
grab a VM locally and debug
The only possible issue I can think of is that I need to make sure it is valid before calling next. I'm committing that change now and hoping for the best.
they have vagrant profiles, where you can run their builds locally
The good news is that travis finally updated HHVM so callable works now.
Finally get to see if Ardent is HHVM compatible ^^
18:20
++
I'm hoping to have my RFC draft discussion ready (sans patch) by next week.
I think mostly everything is there it just needs to be polished.
(Yes, that's me)
lol, I gathered
just 2.3 years ago^^
My question (for the member access case) is, in the context of a method definitions' parameter list, should $this be available?
18:25
it is available. You just can't use it by syntax.
user2286243
@LeviMorrison he.he got a ping
@bwoebi Interesting; I'm looking at it more broadly; in other languages, the this reference/pointer isn't made available until the method body scope; expressions in the parameter list are in a sort of scope-limbo.
Rather, not a scope-limbo, but certainly not of the classes' scope.
@DanLugg PHP is actually fetching the passed parameters via specific opcodes inside of the method…
@bwoebi So $this could be resolved correctly at that point, making it completely do-able.
yep
18:29
Neato; shame that hasn't been leveraged.
Though, I reckon someone would make code-pudding out of it in userland, and people would complain, etc., etc.
@DanLugg ^ this.
Not putting myself on any pedestal, but PHP has a pretty fucking low common denominator to accommodate.
yes.
Shame that its... accommodated; y'know, seeing as this is computer programming, not finger painting with feces.
BAH WELL.
@DanLugg Sometimes it feels like it though :)
18:37
user image
3
@DanLugg s/finger/face/
@ircmaxell Might have to do this; my valid check apparently did nothing to help Travis.
:/
18:52
@LeviMorrison yeah, it's not hard to do
^^ Average PHP developer
@DanLugg Looks above average to me. Pulling off the bowl-hat and flag combo!
Bloody AdBlock, I was getting "Request Failed" without any further explanation, seems that URL was qualified as ad.
user924016
19:08
lol Dan
19:18
I just call em' like I see em'.
19:31
too many devs reinventing the same wheel with more lines of code. sometimes you should just think inside the box.
I like that quote.
user2286243
Are PHP frameworks version 1 (Symfony, Cake PHP, ZF..) still used?
I We don't care.
Much care. Such not. Wow. Very MVC.
19:49
@VarunAgw Not by anyone sane, no.
user2286243
@LeviMorrison Great! Thanks. Now I don't have to learn them
Could somebody please tell me why this:
    $stmtUpdate = $dbConnection->prepare('UPDATE leads SET reminded = 1 WHERE id = :id');

    $stmtUpdate->execute(array(
        'id' => $_SESSION['leadId'],
    ));

    $data = $stmtUpdate->fetch();
Results in:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2053
Because you're using fetch with UPDATE
7
Q: PDO error: " SQLSTATE[HY000]: General error " When updating database

Eoghan OLoughlinI am getting an error when updating a database using PDO. I am new to PDO so maybe the problem is a small one and I just don't understand. Funny thing about the error, the command works fine and the database does actually get updated. But it still returns an error back at me. Code: try { $s...

Oooooooooh fuck me
It is too late for me
Copypaste in wrong position
I just googled pdo general error 2053 and took the first result (which is the link above) :p
19:56
tnx!
@3ventic I got nothing in my results :(
0
Q: SQLSTATE[HY000]: General error: 2053

Arpan GuptaI am getting this error randomly in my PHP project. I am using Laravel framework. I googled around a bit and found that is an issue occurring due to PDO. I tried to log the query I am trying to run just before the error occurs and when I copy and run the same query through MySQL, it runs absolute...

Damn you targeted search results
true dat :)
I just coded my mysql class again today, I need to check if I forgot that same thing..
20:26
@PeeHaa You forgot the :, tada.
No, it's not, you suck.
Unfortunately, I will have to pass it because I'm currently employed. P.S. Unless the owner is Sheikh and will buy me a Porsche and apartment at Burj Khalifa, it doesn't have to be a big one.
Some recruiter sent me 5 messages asking me to come to Dubai to work on some commerce website.
!!help
oh
It's too late for you too.
:P
@DanLugg hey! spagetti soup code is the backbone of php! I detest this comment.
20:41
1 message moved to bin
@JoeWatkins Who is you?
@webarto Y U SILENCE TEH TRUTH?
I slipped :P
21:16
yay finally I am don e for today
@rdlowrey :)
@tereško It's a pretty reasonable and common performance optimization. You'll the pattern a few times in any major framework ;)
well, except that most stop at 3 :D
@ircmaxell BTW it had to do with count($iterator) when the iterator didn't implement Countable. I'm not quite sure why it was an issue on some platforms but not on others.
If something has a probability of 1% (so to say) in terms of security, is that a high risk?
Maybe its catastrophic risk...
21:32
@SampoSarrala I thought so, thanks for the link, didn't know the name.
Low risk in my case :)
Good for you :-)
I'm patching it by the way :P
@webarto depends on the context , but it seems really high
It's related to affiliate program, one could potentially be referrer for new customer without the customer actually clicking in affiliate link and therefore be eligible for commission. @tereško
@webarto Meh the new customer is what counts right?
that is not a "security risk". It's called "business costs" or "acceptable losses"
22:06
Right, it's not even about the "losses", but possibility to manipulate. And what @PeeHaa said.
@webarto If a nuclear power station blew up 1% of the time we'd all die 3 1/2 times per year, personally I find that to be a little over the rate I would prefer
Hah :) I just don't like to leave it "open" if it can be "closed".
@LeviMorrison it shouldn't be... That should be an error
No, count is valid on any object.
If it doesn't implement Countable it will count their properties (or something like that, never quite pinned it down).
Sort of how you can use any object in foreach and it will iterate over the properties if it doesn't implement Traversable.
22:22
that should be an exception...
If the parameter is not an array or not an object with implemented Countable interface, 1 will be returned.
GDI PHP...
RTFM
1 is a great number to return, right?
Hey, this operation doesn't make sense, let's return 1!
@LeviMorrison Seems sensible enough to me! </sarcasm>
22:24
Also, I'm actually prepping a PR for HHVM o.o
@LeviMorrison Traitor.
ArrayIterator::seek doesn't throw OutOfBoundsException when it should. Since that code is actually written using PHP I can fix it
3v4l.org/7sNn7 -- biggest BC break... ever... (if we "fixed" it)
wow,var is deprecated?
ah wrond version
@LeviMorrison they didn't just steal the reference implementation in php-src?
22:28
They wrote it in user-land using PHP.
Much faster that way.
@LeviMorrison Oh we don't have ArrayIterator in the PHP files, just a stub.
hihi
damn it when will they fix this damn bug and make chat work as a terminal
@DaveRandom fatal: Not a git repository (or any of the parent directories): .git
PHP Storm seems to have gone a bit craxy and started refusing to push, I have to do it on the command line even though Ican commit and pull just fine through the UI
Yeh it's just not annoyed me enough to try and work out why yet, I'm sure it will eventually
@salathe I can think of much bigger BC breaks.
In case anyone is wondering, HHVM takes a lot longer to compile compared to php-src.
@LeviMorrison around 30 mins on my box
22:42
Lots of time for sword fighting then!
Honestly, I don't believe the JIT is responsible for this extended build time.
This is nuts.
Please fix, Facebook!
@LeviMorrison it's not
@LeviMorrison So called because it compiles Just In Time for you to lose interest and go do something else
A build time over 10 minutes is crazy. I know some projects are much longer but this is just PHP.
ah, zem naysayers
at least I'm able to read through that code :)
and even fix shit without having a mentor
22:47
I compile php-src in less than 2 minutes
@Ocramius The HNI was a good move.
PHP-src should something similar.
well, PHP-CPP is doing that (kinda)
but yeah, I know that mongodb has a load of interns working on the mongo driver for hhvm
@LeviMorrison make -j32
@ircmaxell doesn't make it faster here (already tried) :X
@ircmaxell I am doing -j 8 with it (I have 4 cores with 8 hardware threads, so any more shouldn't theoretically help)
All this work so I can run three test cases ^^
make is fast, make test is not
23:17
At least rebuilds aren't too bad.

« first day (1258 days earlier)      last day (3916 days later) »