« first day (2145 days earlier)      last day (2800 days later) » 

12:02 PM
I am calling a php file which executes a python script. If I run the script twice(parallely) the exxecution time shoots up(almost twice). when am running it once, it's executing properly.
 
Uh, so apparently 5.x the default state for assert.active is "On", and php.ini-production does not turn it off.
 
I don't undertand why. I even added session_write_close(); at the end
Where can I change that value to off? I check phpinfo file it says assert.active 1 1
 
In your php.ini, or using assert_options()
 
[Assertion]
; Assert(expr); active by default.
; http://php.net/assert.active
;assert.active = On
I should uncomment last line and set it as "Off" ?
 
For production yea. I was just reading about some LFI where people are using assert() as an eval()
 
12:07 PM
@driftking9987 Leigh wasn't answering your question
 
Ohh. My bad.
 
@Danack IMHO there should be new OO api like with FIle, FileInputStream, FileOutputStream, Stream - such without resources where streams files etc are objects /cc @nyamsprod
 
@brzuchal Everyone wants resources to die, but nobody is killing them. So if you're looking for a project please feel free.
 
I would if I have good skills in C programming
 
Can anyone please point me in right direction?
 
12:16 PM
hi all
 
hi to all
 
@PaulCrovella I feel like Junior Dev in front of such changes in API if I could I would redesign all API OO way but it looks like it needs few contributors :(
 
@PaulCrovella kill resources pls. kthxbye.
 
@brzuchal well having stream_get_meta_data to work on SplFileObject would already solve 60% of the problem right now
exposing the inner filepointer would solve the remaining problem while waiting for the resource to die
 
oh my god - now people in the meeting are saying we should develop our own in-house forum platform.
Because we don't have enough actual stuff to do.
 
12:23 PM
but then you're mixing OO API with procedural API, there were such functions working with objects and then they even have no good docs php.net/manual/en/function.date-diff.php
 
@nyamsprod or exposing SplFileObject's private openMode property rather than mucking about with special-casing that in stream_get_meta_data
(var_dump your SplFileObject if you want to see it)
 
@brzuchal Having specific types is a good idea. I'm really not so sure about OO. Using inheritance rather than composition doesn't seem to good results....
 
type hints, return types all those benefits can be reached
with resource it's impossible
good OO API could increase readability
type hints and return types increase security of implementation
there will be less bugs, they can be found at writing implementation, not at runtime
IDE would point an error while writing code
all of those could hipotetically increase speed of writing code with less runtime checks and debugs
 
@brzuchal The downside of OO objects is that they are harder to composite together.....and any mistake in the inheritance tree design lives forever.
> IDE would point an error while writing code
 
@PaulCrovella even more fun, it's one of those "you can see me in var_dump() but I'm not a property" properties :P
 
12:29 PM
My IDE does this for procedural code anyway....it just needs to have specific types, rather than just "resource".
 
@Danack resources also lives forever
 
@salathe yeah, I figured as much
 
@brzuchal ...but that's not an argument for using inheritance in a new IO library.
 
socket/stream_socket non-resource impl would make me really happy
 
@Danack but why do you want to introduce new type like file, stream etc. they are all connected with some behavior and thats what objects are for, isn't it right ?
It's nice to see $file->setMTime(...)->setCTime(...)->coptTo(...) in front of filemtime($fp, ...); filectime($fp, ...); etc. and no need to pass that $fp all the time
 
12:35 PM
@brzuchal I prefer the term types.....types enforce that the parameter is a certain type. Using objects with methods on the objects leads to people doing shitty inheritance things. See the whole SPL file related objects for example of this in action. You can have the type safety by just using types, but not using methods on the objects:
interface FileInputStream {}
interface FileOutputStream {}

function fis_read(FileInputStream $fis) { }
function fis_write(FileOutputStream $fos) { }
@brzuchal method chaining is not something that is universally liked...
> no need to pass that $fp all the time
That is less of a concern than forcing everything through OO composition patterns...
 
But what is the purpose of having interfaces which no one will be able to implement ?
 
Oct 16 '14 at 19:02, by Danack
@DanLugg You cannot get an OO design that is correct for everyone. With procedural code you can composite things together to make your own OO code that satisfies your needs - it is far far more difficult to composite stuff together when basic functionality is only available through OO code - aka http://en.reddit.com/r/PHP/comments/2i3e1i/a_possible_future_for_php/ckylu94
@brzuchal It forces type correctness when passing parameters around.
function myOwnFunction(FileInputStream $fis) {
    // I know that $fis is of type FileInputStream
}
 
So how would that fis_read() function works on $fp = new class implements FileInputStream {};
 
@brzuchal Depends on how it's implemented between the { and the }
 
Ok but then inside your function myOwnFunction you need to find in the docs some global function to read from that stream
 
12:39 PM
The interface FileInputStream will probably define some sort of method readLine() which you will have to implement.
And then fis_read() will use to some extent.
 
OO gives you autocompletion feature in IDE
 
@brzuchal sorry I got mixed up - I was thinking about internal types, rather than userland types.
 
Those are types.
Any strongly typed language, OO or not, with a decent IDE has that.
 
(I am in the stupidest meeting and it is making me stupid.)
 
12:41 PM
Most weakly typed languages with type inference will also have good autocompletion.
 
mornings. and good luck @Danack
 
(See: Clojure)
 
@FélixGagnon-Grenier moins
 
@MadaraUchiha Is Clojure the only one which has it? I don't know Closure.
 
@brzuchal Clojure
 
12:42 PM
@DaveRandom okay seriously. wtf.
 
@brzuchal s/Closure/Clojure
 
Also, no, not only. It's just a good example.
 
Most of typed languages just use OO style
In those cases
 
@brzuchal No.
 
@NikiC oh, writes, fuck knows :-/
 
12:43 PM
C is a strongly typed languages (kinda, C is weird) and it's not OO at all.
 
@FélixGagnon-Grenier it's festival season!
 
Jun 13 at 8:18, by DaveRandom
Feb 10 '14 at 12:54, by DaveRandom
Perhaps you'd prefer this. Or this.
 
riiight.... :p
 
Facebook is a new delight every day atm
 
@Saitama ah dude
 
12:44 PM
Comparing C with PHP doesn't fit here
 
funny however how there not a single hair on this guys body, except for the genitalia
 
@brzuchal Alright then, Scala is a strongly typed language, and it's functional.
 
@FélixGagnon-Grenier heh. lol
 
Haskell as well (VERY strongly typed, stronger than Java)
 
@MadaraUchiha I'd say C is a statically weakly typed ^^
 
12:45 PM
@brzuchal I will try to write up wtf I'm on about later - going to be travelling, so will have some time.
 
@FélixGagnon-Grenier yeh I'm not a hairy person
 
@Danack Ok
 
TypeScript is whatever the hell you want it to be.
@NikiC Yeah, that's a fair definition.
 
Wait, there could be procedural and OO style API as well together right ?
 
@brzuchal Of course.
See PHP as a prime example for that.
 
12:46 PM
yeah, being ninja'd and stuff
 
Sure, you have classes, and interface, and you can definitely call it an OO language
Or you can totally ignore all of that and do everything procedural.
 
So it would solve anyones problem right ?
With interfaces and etc.
 
sadly, apparently some core contributor don't care about this as a strenght
 
@brzuchal A good language allows you to express yourself in whatever style you want
And not necessarily with "how it should be done"
PHP fulfills that requirement, which a lot of other "better" languages, don't.
Try to not do things The Java Way™ when programming in Java
Tell me how you fare.
 
It's impossible
 
12:48 PM
There is no "PHP way"
You can do whatever the hell you want.
 
static methods all the things
 
But it's fine for me to write code Java Way style
I feel it's easy to read
And understand
 
hey all :)
 
@brzuchal Whatever works for you.
That's the beauty of it.
You can do whatever works for you.
Whatever brings you and your product value
 
@brzuchal yes....you can build an OO api on top of procedural code.....but it's much harder the other way round.
 
12:50 PM
@Danack Not particularly.
 
I'm a dreamer. I dream of a fully object-oriented and compiled PHP and delivering to the client binaries :(
 
Naively speaking, you can mechanically take $obj->method($param1, $param2) and convert it to class_method($obj, $param1, $param2)
@brzuchal You're dreaming of Java.
Stop it.
 
:P
 
@MadaraUchiha Nooooooo..... I'm dreaming this because I do not want my client to see code. Right now I have to pay for some obfuscator-encryptor which doesn't really exists for PHP 7
 
@brzuchal Bullshit. I can guarantee you I can break any obfuscation you place.
Given time.
If you're worrying about your clients stealing your code, stop working with them.
Get better clients.
 
12:54 PM
Those two never exists both at the same time. It's impossible to write code in PHP 7 and use for eg. ZendGuard because it doesn't support it yet. It's been about a year with no support fo rnew PHP.
 
what? hiding code is even a thing?
why?
 
I can't find another clients when selling one product for hundrets.
Compiling to binaries do the stuff
 
Obfuscators do absolutely nothing against another programmer that has a bit of grey matter between their ears.
 
12:56 PM
It would be even better to deliver some OPCACHE caches without source code, but it look's like there always must exists even empty file so opcache will work properly
If I could place OPCache cache files instead of source files it would be quite enought for me, then I wouldn't have to use stuff like ZendGuard
And will always have such feature with new releases of PHP
 
Obfuscators at least make it hard to read, OPcache doesn't even do that, one would be able to (almost) completely recover whole codebase, unchanged with file hierarchy. I guess standalone product development sucks when your clients are willing to steal your work
 
I't not only about stealing code, it's more secure to deliver some machine readable code than human readable as a standalone soft
 
IIRC you can feed opcache a cache file
 
Yes there is a way, but it still need an empty file in original path with unchanged timestamp
And it's located in some strange directory rather than the same directory as original code
Just for protection a machine readable file instead of source code will be sufficient.
 
Dec 16 '15 at 14:11, by Gordon
though what I was thinking of was more like doing something like javac does for java files, e.g. compile my app to opcodes first, then deploy and run that, completely bypassing the opcache
 
1:08 PM
?
 
@brzuchal ^ like that?
 
@Gordon yes, exactly the same thing
 
@brzuchal yeah, you are not alone with that idea. just no one did it yet
 
opcache is able to create such files but I think they should be in same directory something like *.phpc maybe or something
Or even with some option to replace original paths
Also was dreaming about packing whole the stuff into single *.phar like package which could be then even more optimised internally
such packages even could be delivered as an vendor package with all the static resources
Basically I see there are lots of features people want to see in PHP but lacks of people willing to implement it. Am I wrong?
 
1:25 PM
Not really, this whole chat is full of people who can implement stuff in internals, there are people who will vote out a lot of features, they are not in this chat
 
@brzuchal That's a simplistic view of it. Just because some people want to see a feature in PHP doesn't mean it should be there, whether there are people willing to implement it or not. Even the people who want that feature won't agree on the details, many of which can be deal-breakers for them.
it's not enough to want a thing and build a thing, you need to be able to address the desires and concerns of many others
 
Yeah. My bad, sorry.
I'm just confused of lazy evolving.
 
Eveningsr
 
1:44 PM
I wonder why there are lot of people out of this chat who doesn't care about language evolution. So the can successfully diwnvite everything?!
Sory for typos, am on mobile.
 
@brzuchal I'm not sure exactly what you are saying, but I feel you are making a lot of assumptions which would gain in value by being exposed and discussed. What lot of people? Where does that impression of their intention comes from?
 
@brzuchal don't mistake them as not caring. people can disagree and care.
 
You're both right. It's of dreaming about Java.
 
Their vision of the language is just different, this is not a problem of someone being bad or good. Just that there is no leader in PHP as it is completely community-driven project so people have to agree in order to change something, and people often don't agree.
 
<3
so... we're the communists of programmers?
 
1:52 PM
It's just sad seeing RFCs on generics, typed properties, enums, class scope modifiers and annotations. And none of them existing in language yet.
Is it possible to became a voter?
 
@brzuchal Nope. Not possible.
 
So what will happen when this community get old and we'll have 2030 and tge community will still diwnvote those evolving changes. Aaaaaaaaaa
 
downvoters will also get old.
actually, I'd be interested in a vote distribution relating to the age
 
I don't know maybe I am just complaining and should stop looking for impossible.
 
2:02 PM
@brzuchal Some of those RFCs you mention have not moved forward because they are missing an implementation or have technical/performance problems in the implementation.
It's not that they're getting voted down, most of them just haven't even been brought to a vote.
 
morning
 
But this is still sad.
 
... learn c?
 
Fuck you too.
:-P
 
2:12 PM
wtf
 
vilipend: to regard or treat as of little value or account.
 
@CharlesCraft50 that is a vilipendous greeting
 
hahaha
lol
 
<insert vilipend/@PeeHaa's mother-based joke here>
cba today
 
2:14 PM
@DaveRandom i don't understand.
 
Understand what, sorry?
 
!!plugin list
 
Currently registered plugins:
[X] Canonicals - Posts links to canonical resources on various subjects
[X] ChuckSkeet - Posts a random Chuck Norris/Jon Skeet joke on request
[X] CodeFormat - Asks users to format their code when unformatted multi-line code blocks are posted
[X] PHPDocs - Searches the PHP manual and displays links with a summary of the result
[X] 3v4l - Executes code snippets on 3v4l.org and displays the output
[X] Google - Retrieves and displays search results from Google
[X] Github - Displays Github status, profile, or repo information
 
oh, the trenslete plugin is not there yet :(
 
The "fuck you too" was in response to the suggestion that you learn C, implying that this is not something that one would wish on anyone else, it's an insincere dig at C as a language
@FélixGagnon-Grenier I saw the PR but did not have time to sit down and work out what it was supposed to do/test it
 
2:17 PM
:D
 
!!dad
 
lgtm in terms of the mechanical parts, but I'm not sure what it's supposed to actually do
 
What did the grape do when he got stepped on? He let out a little wine
 
@DaveRandom it replaces prepositions with other prepositions
 
2:18 PM
I might work in screwing up vowels at random too
 
@PaulCrovella I is unsure of when they does rewrite le pull request
 
meh, I'll just merge it and let you test it
moment
 
Haha
 
2:20 PM
I am heading home now and leave you with simple-regex.com/examples#url for your amusement
 
Yesterday I farted in the Apple store and everyone had to evacuate.. cos they didn't have Windows
 
!!uptime
 
@DaveRandom I have been running for 9 seconds, since 2016-08-30 14:21:31
 
!!plugin list goochle
 
Command endpoints for plugin 'Goochle' (enabled):
[X] Trenslete - Trensletes text aboard ruining your prepositions. (Default command: goochle, Mapped commands: goochle)
 
2:22 PM
there you go
 
Wes
i should be a futurama/simpson cartoonist
 
!!goochle being a good developer is all about self-improvement and not about asskissing some random professor
 
@FélixGagnon-Grenier being circa good developer is all w/i self-improvement and not in accordance with asskissing some random professor
 
2:24 PM
@Gordon oh good, someone's taken the easiest parts of regexs and made them needlessly verbose.
 
Morngins
@DaveRandom tnx
 
@PaulCrovella And then created a bunch of incorrect examples for people to copy and paste (for example: their domain syntax can't handle dashes or IDN)
 
Wes
@FélixGagnon-Grenier i wasted my life
 
@AllenJB I can think of no better way to demonstrate its usefulness.
 
2:27 PM
@DaveRandom omfg they just keep coming :D
 
Not while they are looking at that they don't
 
Sweet, booked in at the ibis for NW
 
Wes
@DaveRandom should be funny but it isn't. very accurate though
 
note: I just assumed that clip is actually the one I wanted because I can't open YT videos without changing my DNS and I didn't bother
 
Wes
are you in north korea? :B
 
2:36 PM
@tereško also tesseracT is really nice. keep posting music like that, I can't get enough
 
@Wes work blocks a few time-vacuum sites on the internal DNS, obviously I can easily bypass it (this is intentional, it's mostly just an "are you sure you want to waste your time?" check)
 
uhhhm yeah I am sure obviously :P
 
but they haven't blocked chat.so?
 
Wes
lol
 
Well no, I'm the one in charge of the blocking config :-P
 
2:39 PM
lol
 
Eventually I will configure it in such a way that I can have both internal and unfiltered external DNS work on my machine without changing the config but... meh, I can live with it like this. It prevents me from wasting too much time on the internet :-P
It's really there to prevent the Great Unwashed Masses in the call centre from fucking around on FB all day
but because our internal architecture sucks and I am lazy it affects everyone
 
!!rfcs
 
Does anyone comprehend the Yasuo one and can explain it to me so I know why i should vote no?
I mean I assume it's bonkers as usual but I don't want to vote on it unless I have a vague comprehension
 
@DaveRandom Isn't "much of it is unintelligible" enough of a reason for you?
 
2:57 PM
Not for a vote... unintelligible to me != nonsense - some things I don't understand make sense to some people. History dictates that this is probably nonsense but I don't want to cast a vote on that basis
It's doubly difficult with Yasuo's RFCs because there is a language barrier as well I think, so it takes quite a lot of effort to figure out that it actually doesn't make sense, rather than just being poorly explained
 
@FélixGagnon-Grenier hehehe I am tempted to fix the script :P
 
hehehe
to help them? what a douchebag
 
:D
 
@rdlowrey so quiet again? :-/
 
@DaveRandom The language barrier is what I'm talking about - if the language used in an RFC cannot clearly express ideas even at the most basic level then it leaves people guessing as to what the RFC says (or relying on someone else's guess - and I've heard many different interpretations of his RFCs in the past.)
In that state it's not an RFC that can be evaluated. That's dangerous.
 
3:09 PM
It's not just the language barrier though
 
@PaulCrovella meh, you can see in the C code what's going on, but even what's expressed there is not very helpful for PHP
 
he tends to make statements without any explanation / examples / proof besides random snippets from the web on why that specific solution is a proper solution
 
that's true
 
@PeeHaa I don't expect it is. What I'm saying is that barrier is enough.
 
That's also true
 
3:13 PM
@PaulCrovella only when people start voting for it though. It's an open vote so we have protection there.
 
@tereško did you also do coop of saintsrow?
 
nope
didn't have anyone playing at taht time
... but I don't think I lost anything important
 
kk
 
@bwoebi The C code isn't the RFC. It can and does change post-vote. Usually the RFC is the constraint on how it can change, but when you can read anything (or nothing) into an RFC there is no longer that constraint.
 
@PaulCrovella I mean, the C code shows the expected behavior the RFC fails to explain
 
3:21 PM
@DaveRandom Is the return result supposed to be chained or nah?
@DaveRandom This is how I feel about most of his RFCs.
 
@LeviMorrison in what sense sorry? The way linq works, you can do stuff like $collection->where(^$o => $o->isActive)->select(^$o => $o->prop) if that's what you mean (each call returns an IEnumerable that wraps the inner IEnumerable, such that it's only iterated once and all operations are applied during that single iteration
or do you mean something else?
 
You didn't chain them earlier.
8 hours ago, by DaveRandom
@LeviMorrison $collection->select(^$o => $o->prop); $collection->where(^$o => $o->isActive); - tbh just look at linq examples and rewrite them in PHP. I do stuff like both of those ^ all the time
 
No, they are standalone operations in there own right but they can be chained
and btw the outer-scope thing (which I forgot) when I was writing is $collection->where(^$o => $o->foo == $outerFoo)
ugh I cannot type today
 
you cannot type the word "today"?
 
Yes, I also have problems with "molybdenum"
 
3:30 PM
I recently found out that the pronunciation of epitome is totally stupid
 
s/epitome/English/
 
@NikiC i-pit-e-mi? wow…
 
$youngPeopleDetails = $people
    ->where(function ($row) { return $row['age'] <= 50; })
    ->orderByAscending(function ($row) { return $row['firstName']; })
    ->thenByAscending(function ($row) { return $row['lastName']; })
    ->take(50)
    ->indexBy(function ($row) { return $row['phoneNumber']; })
    ->select(function ($row) {
        return [
            'fullName'    => $row['firstName'] . ' ' . $row['lastName'],
            'address'     => $row['address'],
            'dateOfBirth' => $row['dateOfBirth'],
$youngPeopleDetails = $people
    ->where(^$row => $row['age'] <= 50)
    ->orderByAscending(^$row => $row['firstName'])
    ->thenByAscending(^row => $row['lastName'])
    ->take(50)
    ->indexBy(^$row => $row['phoneNumber'])
    ->select(^$row => [
        'fullName'    => $row['firstName'] . ' ' . $row['lastName'],
        'address'     => $row['address'],
        'dateOfBirth' => $row['dateOfBirth'],
    ]);
 
Jay
can anyone point me in the right direction for making a soap service with using a class file to build and validation against the incoming xml file? The class file will be the schema
@LeviMorrison I feel a move to trash coming
 
@Jay Only if someone else is spiteful ^_^
 
Jay
3:33 PM
haha I get moved all the time
 
@LeviMorrison there … is a reason why we have SQL…
 
@bwoebi Hey, I took it verbatim from Phinq.
It demonstrates boilerplate of functions pretty well, at least.
 
@LeviMorrison ->where(function ($row) use($minAge) { return $row['age'] <= $minAge; }) to ->where(^$row => $row['age'] <= $minAge) with closures
@Jay please do not make a SOAP service. Please.
I'll be your friend.
 
Jay
@DaveRandom why man?
 
Only someone who has never worked with it would ask that question. That should be all you need to know.
 
Jay
3:39 PM
lol your nice
 
It's designed to be humorous, but the underlying point is dead serious.
 
Jay
I have done it before but not the way I was asking
WHat makes you think I want to be your friend anyway haha
 
he'll be whatever you want him to be (for real, check the sidebar)
 
:-P
srsly though, why would you want to create a SOAP service in PHP?
 
@DaveRandom Good idea, though it would be $maxAge. I've modified my example in the RFC.
 
3:43 PM
were there any issues with using PHP_EOL when writing a file ?
 
Jay
@PaulCrovella sounds like your under the thumb
 
@DaveRandom s/in PHP//
why would you even want to touch soaps with a 10 parsec stick?
 
Jay
It's a request from work. I didnt decide
 
[The only valid answer is: when information will come back to me, I'm already retired.]
 
Is there any implication of calling execute without bindParam in pdo
 
3:49 PM
@tereško other than it being unnecessary in general, no, it's just a regular string constant that's defined at startup
 
@ChrysUgwu ... what?
 
Is it perfectly fine to use executive without bindparam?
 
I mean... there can be different implications, depending on wether there are parameterized values in your query or not
 
@ChrysUgwu Do you mean without actually using prepared statements?
It's a useless extra round trip
 
@Jay well if you really must, I highly recommend not doing it in PHP if at all possible, almost all SOAP traffic is between microsoft tech because they at least all speak the same flavour of SOAP. I you must do it in PHP... what exactly do you mean by "class file"?
 
3:51 PM
Yeah with prepared statement
 
@ChrysUgwu if there are no parameters in your query, no problem, it's not needed. otherwise your query will fail
 
Do you mean you want some tool to generate a WSDL from PHP classes?
 
also you may want to stick with bindValue for the moment
 
Jay
@DaveRandom like a file that contains the schema which I can use to validate the incoming xml contents with
 
@Jay that's what a WSDL is for
 
Jay
3:52 PM
@DaveRandom what would you say is best for getting data and making sure its valid and then returning a result?
yea
I am using wsdl
 
then that's where your schema goes
You can use XSLT includes to split it across multiple files
however there's rarely any point in this
 
I think y'all are getting ahead of yourselves. @Jay, first you're gonna want an smtp server.
 

« first day (2145 days earlier)      last day (2800 days later) »