« first day (2111 days earlier)      last day (2837 days later) » 
00:00 - 13:0013:00 - 00:00

1:00 PM
@Wes yes
 
Wes
i mean, it's clearly normal for php, but wouldn't be better if it casted to php_int_max?
 
you guys would have a lot of fun with the code-base I am upgrading right now for php7
if (!defined("PHP_VER_LOWER43"))
	define("PHP_VER_LOWER43", version_compare(PHP_VERSION, "4.3", "<"));
 
@staabm burn it
 
Wes
with napalm
 
1:02 PM
@staabm with nukes
 
/**
 * ensure that strspn works correct if php-version < 4.3
 */
function _strspn($str1, $str2, $start=null, $length=null) {
    $numargs = func_num_args();

    if (PHP_VER_LOWER43 == 1) {
        if (isset($length)) {
            $str1 = substr($str1, $start, $length);
        } else {
            $str1 = substr($str1, $start);
        }
    }

    if ($numargs == 2 || PHP_VER_LOWER43 == 1) {
        return strspn($str1, $str2);
    } else if ($numargs == 3) {
        return strspn($str1, $str2, $start);
<3
 
omg
 
Wes
> Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask.
find me an use case for that? :B
 
@Wes pretty sure that's the quickest way to find out if a string is numeric
eg if strcspn() != strlen
 
lol @staabm
 
Wes
1:09 PM
staabme
 
Staab hammertime
@Wes hehe
 
Anyone here pro at docbook?
 
Is there such a thing? :P
 
@rtheunissen I think @bwoebi is
 
hehe
I think the closest you can get would be @salathe @rtheunissen
Sorry wrong ping
 
1:14 PM
There is no Docbook dashboard yet.
 
Cool, thanks. Something isn't linking properly and I can't figure out why.
 
You can always dump it in here and maybe somebody can guess what's going on
 
XPointer evaluation failed: #xmlns(db=docbook.org/ns/docbook)
 xpointer(id('class.ds-deque')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])
I have a theory.
 
Care to share it? :P
 
It's in the "Class Synopsis" section, where it lists all the methods of the class.
But the three classes that fail (deque, vector, and pair) only have the methods of the interfaces that they implement.
So the xi:include fails, and produces this:
 
1:18 PM
What does the xml look like?
 
  <section xml:id="ds-vector.synopsis">
   &reftitle.classsynopsis;

<!-- {{{ Synopsis -->
   <classsynopsis>
    <ooclass><classname>Ds\Vector</classname></ooclass>

<!-- {{{ Class synopsis -->
    <classsynopsisinfo>
     <ooclass>
      <classname>Ds\Vector</classname>
     </ooclass>

     <oointerface>
      <interfacename>Ds\Sequence</interfacename>
     </oointerface>
    </classsynopsisinfo>
<!-- }}} -->
    <classsynopsisinfo role="comment">Constants</classsynopsisinfo>
    <fieldsynopsis>
It's at the bottom, before the closing "classsynopsis" tag.
 
God docbook is godawful
 
It's been a struggle.
xml is godawful.
 
hear, hear
 
Tempted to spend a few weeks migrating and rebuilding the entire PHP documentation way of life.
 
1:22 PM
I had a quick looksy, but clearly I am too stupid to be able to help you :(
 
I'll just create an issue on the repo. :(
Thanks
 
Hi!
 
o/
@PeeHaa o/
 
hola boot
 
How you doing?
 
1:31 PM
I am thinking about ordering this thing for work: overclockers.co.uk/…
 
As long as the keys are on my current one I won't buy an other one. :P
 
@Gordon nice troll.
 
@Duikboot what kinda of kb do you have?
 
Apple Qwerty default one with numpad
I like those 'flat'keys
 
ugh
 
1:33 PM
You don't?
 
Why would someone wast 100$ in a keyboard? A laptop comes with a keyboard...
 
@Manulaiko for the same reason you dont walk around in $10 jeans and $5 shoes. It's not the cost that is important, it the quality of the thing you get for it.
 
@Duikboot he's one of those mechanical keyboard dudes, you know… the guys who annoy you at work because you can hear their typing everwhere
and yes, @tereško, I know some of them are not that loud but that doesnt make them silent ;)
 
@Gordon which is why I will be making a test-run with my home keyboards, before comiting to buying
 
@tereško the main reason why I dont run around in cheap clothing is because cheap clothing must have been produced by cheap labor.
 
Anonymous
1:39 PM
^ this
 
@Gordon and your $800 iPhone was produced by expensive labor .. riiiight
 
Q: I am using an API to fetch data, so blabalbabla/broker?broid=1000 and blabalbabla/broker?broid=2000

When there was no API I used a service
 
You guys know what mlock is?
 
some linux shizzle?
 
@tereško for work at home or office?
 
1:41 PM
@tereško I dont have an iPhone. I have a Nexus 5X and I hadnt bought that if some clumsy person hadnt broken my Nexus 5. I try to stick with my phones for at least two years
 
@Gordon I want them to invent the maglev keyboard. Would look so cool and be silent.
 
@Gordon I had Samsung S5 unscratched for 2 years, and in a few days: 1.) I broke the display 2.) Fell on the concrete...
 
Q: I am using an API to fetch data, so blabalbabla/broker?broid=1000 and blabalbabla/broker?broid=2000

When there was no API I used a service, which gave me all thos 'broid' in a coma seperated string as output... Is there a way I can easily fetch them all? I have no documentation about this ><
 
@Fabor google says this already exists
 
It's just incorrect marketing labeling though
 
1:43 PM
@Fabor how would you transport it around?
 
ForceNoTouch?
 
Magnet lock maybe. Shrug. Leave that for the eggheads to worry about
 
@Duikboot try without the ?broid or try /brokers (plural) or try ?broid=* or try broid=all
 
also, I don't think a keyboard with separate power-brick would get all that popular
 
"errorCode": "NOT_FOUND", :P
 
1:45 PM
@Duikboot link to api?
 
Hmm but there is an API code in it to use it which shouldn't be send public :P
 
you mean a token? dont send the token. just tell me name of the api
 
salesforce
 
ah
they should have docs
 
I received a mail with all docs but not for getting all of them, I can get pefectly a specific ID
@Gordon pastery.net/vberae ;) Makes more sense.
 
1:55 PM
sorry. no idea
Matt Sherman on July 27, 2016
We believe (and developers tell us) that job seekers should be empowered with as much information as possible when looking for a job – especially salary. So we ran an experiment on Stack Overflow Jobs to see if the evidence would support it.
 
I swear every time I see salary stuff for devs it's like a bazillion pounds more than I earn.
5
According to that I am earning half what I would :P
 
Anonymous
@Fabor ikr, depressing af
 
> "We learned that job listings which include a salary range got 75% more clicks than job listings that don’t."
 
I have all my functional tests written using PHPUnit but I now want to redo them using Codeception. Codeception functional tests look more like english and just seem to be easier on the eye. I wrote the PHPUnit tests doing TDD but now that I know all the tests pass and I would be rewriting them using a different tool what would you call the process?
 
it's sooo annoying when you get job offers without the salary range. it makes it so much easier to sort out offers right away
sometimes they write "competetive salary", but one man's "competetive salary" is another one "slave wage"
@tibanez pointless? wasteful?
 
2:04 PM
They should only include devs inside the normal distribution in those estimations. Pretty sure Bill Gates is skewing the results.
 
@Gordon After seeing the Codeception API it is far more clearer what is going on especially to non technical people than the PHPUnit tests. I wouldn't call it wasteful since I would be adding another tool to my arsenal while improving the readability of the current tests (hopefully)
 
@tibanez non-technical people dont read unit-tests
 
They are functional tests
 
@tibanez if you wanna switch to codeception, I'd suggest to do this for new code, but not rewrite all the old tests
 
@Gordon It's really bugging me how much more clearer the functional tests can look using Codeception than with PHPUnit
 
2:08 PM
how long do you estimate it to take?
 
Once I've the fixtures working correctly then I would say no longer than a day and a half. I would do it in my own time because it would be contributing to me learning another testing tool
 
@tibanez ok, so it will take a week :)
 
@Gordon Realistically probably yes
Since nothing ever works like it should at first
@Gordon Have you used Codeception
 
@tibanez if its your own time, then do whatever you want. if its company or customer time, ask your PO/team/whoever if they are fine with it
@tibanez nope, I am fine with phpunit
@tibanez I'd call it a migration btw
 
@Gordon The thing with my PHPunit tests is they are like this: test_asGuest_postAction_shouldReturn401UnauthorizedResponse. In Codeception I can make it look so much more clearer and nicer and the API for sending the request and asserting stuff reads like a story
 
2:22 PM
at my previous project most of the api tests looked like this:
public function testGetFoo()
{
    $this->enableAuthentication();
    $this->doJsonRequest('get', '/foo');
    $this->assertHttpStatusCode(200);
    $this->assertLastResponseEqualsFixtureFile();
}
we had a custom apitestcase extending from phpunit testcase with custom assertions
very convenient thing
 
@Gordon That is similar to me. What do you use to declare your fixtures? Alice and Faker?
 
@tibanez no, they were handwritten phpunit xml files for database testing. that was quite messy
 
setcookie('my_mouth', 'yum', 1);
 
@Fabor umm, wtf is kosher salt?
 
lol
Been a while since I at something truly bad for me. My brain is desperately trying to justify it.
 
2:31 PM
@Fabor maintain the streak!
 
Yeah :(.
So the vault stuff is cool, cooler if we invested in using it fully.
ATM we will use a sledge-hammer for a nail. But the nail will grow in future.
TBH I kinda expect to see this come up in more conference talks in future.
 
Hi is it possible to access my webserver on my vmware from the host machine ? i am using vm ware player
host is a windows machin e
 
@Gordon Don't know, I've seen people wash meat with kosher salt-y water.
 
I thought kosher only applies to meat… but what do I know about these things
hmm, I googled it. Seems more complicated than wordpress on the inside
 
Hi folks...

I'm really disturbed right now, and trying to figure what's wrong with this...
How can
var_dump((true) || (false));

return true .... WTF ?
 
Anonymous
2:42 PM
!!eval <? var_dump((true) || (false));
 
[ 7.0.0 - 7.1.0beta1 ] Parse error: syntax error, unexpected '<', expecting end of file in /in/rk19c on line 1 <br/><i>Process exited with code <b title="Generic Error">255</b>.</i>
[ hhvm-3.10.0 - 3.12.0 ] Fatal error: syntax error, unexpected '<', expecting $end in /in/rk19c on line 1 <br/><i>Process exited with code <b title="Generic Error">255</b>.</i>
 
@JonathanLafleur Why would it be anything else?
 
@JonathanLafleur what did you expect it to give? its a boolean or and one of the conditions is true
 
I expect a false... since one of them is false ?
 
OR
 
Anonymous
2:44 PM
|| makes the expression exist on the first instance of true-thly expression
 
@JonathanLafleur then you need an && not an ||
 
AND ?
But I need to know if either one of the situation arise go to else
 
|| == OR, && == AND
 
if (($priority_page_id !== $post->ID) || ($post_type !== 'cqpp_priority')) { } else {}
@PeeHaa yes I know, I even tried with OR
 
No you don't know
 
2:45 PM
I'd turn that around.
 
Read your code like an English sentence
 
if ($priority_page_id === $post->ID && $post_type === 'cqpp_priority') { }
much easier to grok than foo not bar or baz not qux
 
@JonathanLafleur Switch you then with your else and you'll have what you want
 
Anonymous
tbh, these things are not easy to understand at first, if you are not a programmer or if you are illiterate like me
 
Simple if statements like that are 1:1 english sentences
 
2:48 PM
@samayo you are quite literate for an illiterate :P
 
@Gordon I have two different case... and need to fire the second case if either of one the verification give true.

So if $priority_page_id === $post->ID OR $post_type === 'cqpp_priority' return true...
 
mornings
 
mogoring
 
Anonymous
o/
 
2:49 PM
sleept way to little last couple of days
its hard getting back to work =) but its okay
 
@RonniSkansing It's always horrible having to get used to working again
 
your jobs must suck then ;)
 
My job involves heavy abuse of php of course it sucks
 
@Jeeves you should really ignore a leading <?(php?)
 
what do I put as return type when I want method chaining? : this, self, static, the class name?
 
2:59 PM
@Gordon =p
 
@Gordon self would be appropriate....and should work as a type.
 
@Danack thx
 
@Gordon $this if it's phpdoc only
 
@NikiC then I wouldnt have included the : ;)
but thanks
 
How can I get the GPG signature of PHP 7.1 beta?
 
3:02 PM
@Gordon ah ... in that case self is the only one that works at all ^^
 
Trying to build a docker image for it
 
Hmm - static doesn't work....I thought it was meant to....such a tragedy.
@JoeWatkins I guess maybe you and Davey need to add your keys to secure.php.net/downloads.php#gpg-7.0 ?
 
@Danizord excellent question
@Danizord 7.1 is the same release managers as 7.0?
if so you, can grab them at php.net/downloads.php
 
ha, thanks!
 
@Danizord though it's probably easier to just take github.com/docker-library/php/blob/… and adjust the php version tag
 
3:11 PM
@Gordon yeah I'm doing this, but there is a ENV GPG_KEYS variable as well
I'll keep it unchanged, let's try
 
ah wait, that won't work because it's downloading a tarball and I dont think there is one for 7.1
I guess you'll need to do a checkout from git then
 
in wordpress... how should I select query_posts if a X value is between 2 custom meta?
I read it but its only for 1 value..
 
@Danizord then it shouldnt be too hard
am off for today. cya
 
thanks @Gordon, cya!
 
3:29 PM
hello guys
there is a way to execute a query with PEAR in the middle of a transaction? I have to execute a query no matter what
 
@JoseSilva How is that related to pear?
 
im using pear
 
pear what?
Also why are you doing it inside the transaction?
 
long story, but must be, otherwise i have to change all project
 
...
I think this is my cue to back off slowly
 
3:35 PM
i have to save all reports of all pages, so i'm working with header file, in some pages i have loops with transactions
on almost all pages it work, but when an error occour in DB, a rollback is called -> no logs saved aswell
 
I still have no clue what a pear is and it sounds like you are trying to do something that doesn't make much sense because work
 
yes that's a website
 
its a framework for database's
 
No it is not
It's a repo for php extensions / packages
 
No you are not
You are using either DB or MDB2
 
please, learn to use PDO
 
@JoseSilva pear isn't an actual thing that you use directly in your code
It's like saying I am using a dealer to drive home
 
ok..
so, there is someway to execute a query in the middle of a transaction?
 
No fix your code
 
3:45 PM
thx
 
There is one awful way I actually know of but it's awful
And on that bomshell I am going to do a beer run
 
Anonymous
@PeeHaa you playing tonight shitstorm?
 
4:00 PM
@JoseSilva Sure, just open a new connection to the database.
 
@Danack static would violate LISKOV
 
@Machavity weird, it tells me the question was already closed
 
I fucked up
 
Anonymous
?
 
Anonymous
Ah
 
I closed it, then saw title having "mssql", got confused , reopened and the read that the actually example contains mysql_
 
I can't start a new vote either
But the thread was quite confusing
Fred got it
 
ako
HI there ...can anyone help me with this question ??
2
Q: can't upload audio file to server using PHP script from IOS device

akoi have this PHP script to upload an image or audio file into a server <?php include "config.php"; function GetImageExtension($imagetype) { if(empty($imagetype)) return false; switch($imagetype) { case 'image/bmp': return '.bmp'; case 'image/gif': return '.gif'; ca...

 
DNC
I am trying to scrape the data from this website: djguide.nl/events.p?textsearch=27-07-2016 but the html codes are not being shown, how come?
I am using this : $data = file_get_contents('https://www.djguide.nl/events.p?textsearch=27-07-2016');
 
4:20 PM
@JayIsTooCommon yeah. I already finished my work for today. Going to do the food thing first
 
git.php.net/… … This type of bugs … takes an eternity to find … once the cause of the issue is localized the fix is trivial :-D
 
o/
 
@bwoebi maybe under different circumstances and environment it would have been faster ;)
 
4:49 PM
hi!
@bwoebi is there anything I have to do (other than aerys -c conf.php) to run aerys in production?
 
I am trying to set up an upstart configuration to run it from jenkins
ok, thank you
 
@bwoebi ping
 
Anyone here used predis? I just want your opinion of it.
So far seems good so I am hoping to get some opinions before committing to it.
 
Anonymous
5:09 PM
@PeeHaa okie doke
 
@kelunik pong … if it's again about the same thing, then yes, I've done it today…
 
@LeviMorrison Just saw that it's over-engineered when writing amphp/redis.
@bwoebi Just want to know, because it has to be done ...
 
@LeviMorrison just use the well-established amphp/redis? :-)
 
5:56 PM
> $res->end("$webserver?? What's that? There is only Aerys!");
lol
 
Dream Interpretations (can't make this stuff up sometimes)
 
[WP] someone can be check that? I have a loop inside when I go to /wp-admin ~ /wp-login.php
http://pastie.org/private/o0gndi86wbyffgmubh4bw
 
why you insist on hurting us with that terrible terrible wordpress shit?
 
6:14 PM
what does the @ do in @ldap_connect($Host); ?
 
suppress warning
 
thank you
I imagine I can safely remove it then
 
you should'n
 
My current problem is I need to do a ldap_search() with authentication but I don't know how
there has to be a way to cram a password as a parameter
 
6:22 PM
@Okabe Documentation needs to be humorous in order to keep people reading :-P // btw. feedback is always appreciated :-)
 
I have a variable that has a generated coupon URL but the problem is i'm trying to replace the http with https. i tried str_replace("http","https", $coupon_url);
any tips?
 
Thanks guys, I made some progress today
 
@Gordon Nothing against bluefeet … but yea… bluefeet is the type of people who do that…
 
@Gordon lol
 
6:35 PM
nevermind solved, i had to use preg_replace
 
Anonymous
6:47 PM
> IMO, Docs is competing with Q&A and official documentations for no good reason. The idea to provide docs for otherwise poorly documented projects is laudable, but The One True SO Documentation is a wasteful and arrogant effort. Stack Overflow should not attempt to replace an authoritative documentation made by project maintainers elsewhere on the web. I will not participate in that.
 
Anonymous
^ Spot on
 
@Okabe Feedback and especially PRs. :-)
 
hi everyone,
anyone with codeigniter knowledge, I have problem to update record.
 
7:09 PM
No one in here will admit codeigniter knowlegde
 
7:39 PM
morning
 
7:53 PM
Bah, google is useless for finding well hidden information…
 
8:19 PM
is it okay for a datamapper to use another datamapper?
 
@Gordon They prefer the term "Reputational Service Workers"
 
8:47 PM
@bwoebi And it has a session handler built-in that supports redis cluster?
 
@LeviMorrison there is: github.com/amphp/aerys-session
But there's no SessionHandler directly in the library as this is out of scope
 
API: Unstable
Yeah, doubt the boss will approve that.
 
@LeviMorrison Well, it's as stable as Aerys APIs.
it's not quite unstable, but it will be semver compliant
 
dammit
you know that, when you're working on a private project, and you loose interest because you have no goal to strife for?
 
you mean life?
 
8:56 PM
hi guys
 
yeah live is one of the missing goals in my life
paradox but true
 
I took a look into the Datatables manual but didn't read all of it, it seems that all data is hardcoded!
Which is a weird thing I think
 
Hello everyone ;)
 
Is there a chance to display data from a database in the original way ($_POST) in the datatable?
 
I have very stupid error in PHP (I've just started with OOP, so it might be noob error, but...). Could you take a look?
Catchable fatal error: Argument 1 passed to DayDate::setYear() must be an instance of integer, integer given, called in
"must be an instance of integer, integer given" - it made me saying "WHAT?!"
@JohnyNassar Why would you do that?
 
9:03 PM
because I don't want to create a normal table
I want to make a fancy table with the search option etc
all of tese Datatable stuff
 
I would do like that
```
$toBeStored = serialize($_POST);
///code to store in DB
$resultPOST = unserialize($answer_from_db);
```
 
I dont think you want to blindly serialize user input
 
I didn't understand
 
9:06 PM
its a recurring vector to surface in php
 
@RonniSkansing ahhh, yeah. So maybe let him use JSON format instead?
 
I didn't understand guys, is there a chance to do this in datatable?
@Ty221
 
<?php

//...

$toBeStored = json_encode($_POST);
$data = $sqlConn->real_escape_string($toBeStored);

SEND_TO_DB();

//...

GET_FROM_DB();

$dbPOST = json_decode($VALUE_FROM_DB);

?>
Something like that?
Should work.
@JohnyNassar What do you mean? We have mentioned quite universal solution.
remember about XSS sanitization process before displaying anything user-generated.
 
Imean all of the example in the datatable manual is written with hardcoded values. I'm new to datatables so I'm asking if I can display data from my MySQL database with the original $_POST like displaying in a original table
 
Anonymous
9:18 PM
@Ty221 Can you paste your code in pastebin? :)
 
he's right^^
 
@JayIsTooCommon sure pastebin.com/7qUAZbVi
 
Anonymous
@Ty221 No I meant your OOP issue :P
 
I thought you meant to occupy less screen
 
@JayIsTooCommon ahh :P Sure. I have started to that think no one will help me and almost forget :)...
 
Anonymous
9:23 PM
@Ty221 The type hint for integer is int not integer :)
 
@JayIsTooCommon still doesn't work :( Argument 1 passed to DayDate::setYear() must be an instance of int, integer given
 
Is there anyone who can help me plz?
 
Anonymous
@Ty221 What version of PHP are you on?
 
5.6.8
@JohnyNassar I believe we gave you detailed answer. Please extend your question to get more help (re-explain it) ;)
 
@salathe have you missed my comment or disagreed with it? stackoverflow.com/documentation/proposed/changes/61875
 
Anonymous
@Ty221 Ah, type hinting against integers is only available in PHP 7 i'm afraid
 
So it means I need to upgrade to PHP7 :)?
 
Anonymous
Do it do it do it!
 
or remove the type hint
 
@Ty221 I want to access my data from datatable, all of the examples in the datatable manual is hardcoded data. How can I access my MySQL database and display my data in it?
 
9:38 PM
OK, thanks for your help. I have never worked before with OOP in PHP, always followed procedural programming style. The knowledge I have about OOP comes from Java so I was used to type hinting in that form without any discussion :)
 
OOP has nothing to do with type hinting
 
Anonymous
@Ty221 No worries, come back if you need any more help :)
 
@Ty221 well, that was the lazy answer. if you can install 7 you should, if you can't you could still do a sanity check of is_int inside the function
 
Is this a good implementation of a Dependency Injection Container? github.com/AlexyaFramework/Alexya/blob/develop/Alexya/…
 
Anonymous
10:03 PM
am off, G'night o/
 
so .. I heard that it is racist that Wonder Women is played by actress with white skin color and not representing someone from Amazon
on this encouraging note I will go to sleep now
 
can anyone help me with regex+php+curl
 
10:34 PM
@bwoebi I don't remember seeing the comment, sorry. Either way, it's easier now for someone else to edit it. :)
 
@salathe I wouldn't edit it, I would want to discuss it.
 
11:46 PM
@RowAraujo I think everyone of us has already read it at least 5 times throughly…
 
00:00 - 13:0013:00 - 00:00

« first day (2111 days earlier)      last day (2837 days later) »