« first day (3758 days earlier)      last day (1176 days later) » 

3:09 AM
Has anyone tried enabling GCC 10's static analysis warnings on PHP?
I tried doing a simple search but didn't find any results in commits, etc.
 
4:00 AM
@LeviMorrison Which flags are those?
Cause I've been the one enabling a bunch of warnings
 
4:27 AM
@Girgias -fanalyzer related stuffs.
It's expected to be much better in GCC 11, so I wouldn't stress about any confusing output at all.
I've moved and haven't set up my machine that I run Linux on. Just have my work Mac.
 
 
2 hours later…
6:11 AM
hi guy. im having an issue when i add $_SESSION(ses_id) to my query without that it works. the session is fine it works else where i used it
$query .= "SELECT * FROM product_service_request WHERE User_ID =".$_SESSION["sess_id"];
if(isset($_POST["search"]["value"]))
{
    $query .= 'OR Psr_ID LIKE "%'.$_POST["search"]["value"].'%" ';
    $query .= 'OR Pssc_ID LIKE "%'.$_POST["search"]["value"].'%" ';
}
 in the other area where it worked i removed the search part from the jquery table because i didnt need it but here i need it
 
Biggest problem you have is the you don't sanitize variables passed to query string. You have to use prepared statements. Check [this](https://xkcd.com/327/).
For problem you have here, my assumption is that you should make a space before first ` OR`.
 
@Tpojka a space? okay ill try that
wow it worked it was a joined query didnt know it needed a space. thanks man
 
What you have there is most insecure as it takes. You have to use prepared statements and correctly sanitize variables. Learn bind parameters in PHP docs.
 
6:32 AM
@Tpojka will do that in the next phase first i need to get a working demo. Also am new to pdo first time using it
@Tpojka sanitize variable?
variables*
 
@KhwajaHussamQuasmi Actually it's time to start using it yesterday. With what you have there, your DB data could be deleted any moment probably.
 
7:07 AM
@Tpojka thanks bro. going through this Hibernate Query Language. Will do this next
now the problem im facing is still all the values are showing. what i dont get is i defined the id. ill use a pastebin as the lines of codes are increased
 
I haven't use HQL before. But there are bound parameters too.
 
@Tpojka this peeked my interest its like a session defined query
@Tpojka could you take a look at this pastebin.pl/view/146157bf
the problem here is even though the id is defined the table still shows all the values pastebin.pl/view/146157bf
i can get it to work if i remove the search as it works in another module but i need the search for this module
 
morns
 
morning :)
 
7:24 AM
@KhwajaHussamQuasmi No need to ping me or anybody else. If I have time and knowledge I'll try to help.
@mega6382 \o
@KhwajaHussamQuasmi You mean line 25?
 
mornin room .
 
0/
 
@Tpojka i understand, sorry for the disturbance
 
array_merge - odd behaviour with string keys ・ Unknown/Other Function ・ #80685
 
Check Do's and especially Don'ts if you haven't already.
 
7:36 AM
\o
 
@Tpojka after line 28. here it tells the query to only take rows with that user_id but its showing all the rows in the table. i think the search is causing the problem
 
After line 46 set var_dump($query); exit; and check what is that string.
 
@Tpojka 'SELECT * FROM product_service_request WHERE User_ID = 1 OR Pssc_ID LIKE "%%" ORDER BY Psr_ID ASC LIMIT 0, 10' (length=108). why are we checking this? is their a problem with the query?
should it be "AND ORDER BY"?
 
~~We~~ you are checking this because string as per now is not returning correct/wanted result, right?
You are not checking if $_POST["search"]["value"] is empty or not. Try that.
 
yes :(. Its a search bar it would be empty unless I write a value in it
 
7:49 AM
If empty you shouldn't include it in query I suppose. Your condition should be if(isset($_POST["search"]["value"]) && !empty($_POST["search"]["value"]))
 
o ive figured out the problem. i think i did. The search creates the issue, when i add or

i was typing this. thanks bro :) really appreciate the help
 
You are welcome. :)
@LeviMorrison Check this beauty: "Advanced AI robots have drained the Earth of its natural resources. A rebel human alliance in space with no planet to call home, calls on Bigfoot to do battle with humanity's greatest enemies, the Illuminati." with appropriate name of "Bigfoot vs the Illuminati".
 
 
1 hour later…
9:25 AM
Hey, how to change symphony API output format to JSON?
 
 
1 hour later…
10:50 AM
@NikiC git.php.net/… … wow :-D So, the next proper step is tearing the dependency between opcache and Zend/Optimizer up now?
 
@cmb ping
 
11:13 AM
guys but php fuzzing project it's only for internal ?
 
@bwoebi Or at least making it runable without going through opcache
@BruceOverflow you can run the fuzzers yourself, but the oss-fuzz results are private
 
@NikiC perfect
 
12:10 PM
moin
 
cmb
12:34 PM
@JoeWatkins pong
 
12:54 PM
@Tpojka That stupid, everyone knows Bigfoots are head wizards in the Illuminati because of their ability to disappear. Why would Bigfoot ever fight their friends?
 
@CupOfJava it's obviously subterfuge, have you never even seen a heist movie
 
Bigfoots have been playing the long game this whole time just to flip the script? Who's running this reality, M. night Shyamalan?
 
No the final twist will be that it was all actually Sir David Attenborough trying to advance his right-wing anti-nature agenda
 
It wasn't a documentary after all, it was target recon.
 
He was the CEO of Exxon this whole time. He wasn't hiding it, just no one looked into it.
 
1:09 PM
lol
President Business
 
However I need to see how that begins. I was amazed with introductory scene of Lavalantula.
 
For 2015 the CGI spiders aren't that bad
 
Good morning
 
1:24 PM
@LeviMorrison Haven't looked at those, might do when I get back into the one I'm currently trying to enable
 
After watching this video for the first time when @DaveRandom posted it, I could not wait for Friday to arrive so I could post it again! youtube.com/watch?v=4z95SAFud7w (No Rebecca)
4
 
@CupOfJava for some reason I cannot help but read this more like a restaurant review than a film review
how were they served?
 
@BruceOverflow Only people part of the security team have access to the results
 
@StatikStasis ah lol I forgot about that
 
1:31 PM
There's a "2 Lava 2 Lantula". I want to see the paycheck of whoever came up with that name.
 
<narrator>It turns out it was the same man who named "2 Fast 2 Furious"</narrator>
 
@DaveRandom themoviedb.org/search?query=2%202&language=en-US Well that person is doing really well.
 
I think if I woke up and found myself working on something with a title like that I would just open an artery there and then
 
@DaveRandom 62% user score- wow.
 
What do you think you're 2 Cool 2 Be 4gotten?
 
1:42 PM
I think that is my favourite one for being a pastiche of itself
 
That doesn't even make sense.
 
2 gay 4 lunch
2 tall 2 sleep
 
oh no, Dave got a job in Hollywood
 
I kinda wanna see 2 gay 4 lunch, that could be a real riot, but it could also be the most offensive thing I would ever see... love a bit of jeopardy
 
I know why they can't but my life would be so much easier if search engines would allow you to use regex
I'm an idiot
 
2:28 PM
join the club
 
2:51 PM
 
Can some more people comment on __Invalid_Enum in the RFC: wiki.php.net/rfc/enumerations#serialization This is the last part we're unsure of. The alternative is a failure on serialization (and therefore also in session_start) when it contains invalid enums.
 
Failure is always best. My strong preference is to detect errors as early as possible, not at some arbitrary location 50 calls down the line where the knowledge of why might have been lost
 
DGF
Normally movies with a name like that are very deep, it almost touches your soul. Like the 2 girls 1 cup
 
@IluTov Definitely fail
We should kill the incomplete class concept
 
@MarkR Well, failure for unserialize means returning false. The main point is this: "The reason for this approach is to minimize the breakage of an unserialize() as part of session_start() should stale session data be present after a change in enum configuration We want to avoid a hard-fail in that case that may result in an unusable application." If your session contains an enum that is removed in a later version session_start will fail and also return false.
That was the reasoning at least.
 
3:02 PM
@IluTov I'd personally want my code to fail rather than proceeding in some half baked state. God only knows what kind of weird interactions it might have otherwise.
And people are prone to all kinds of odd logic.... for example if ($_SESSION['ACCESS'] !== UserLevel::RESTRICTED) { ... }
So yes, blow up 100%, preferably with an exception that tells me why :-)
 
@MarkR Problem is, session_start is not always handled correctly. So it only "fails" if you actually handle it.
 
@CupOfJava Hold your horses.
 
@MarkR unserialize currently only prints warnings and returns false. We could make it inconsistently error though. But I'm not sure if the better approach is to be consistent and handle that in a separate RFC for unserailize as a whole.
 
Well if the consensus was to kill the incomplete class concept, it would need an RFC, at which point convert the whole thing to throwing with meaningful errors and that solves your problem at the same time?
I guess the Q would be would that need to wait for PHP 9. If so, you'd be stuck with issuing a warning and returning false.
 
@IluTov Yeah but no old code would use Enums, so I think failling is fine
 
3:15 PM
@MarkR I suppose so. If everyone else is fine with that I certainly am.
 
3:26 PM
Does anyone know of a canonical question about handling checkboxes insertion into the database in PHP?
 
4:17 PM
Hey guys rather simple error I think I am making... I have the following code: dpaste.com/FM6GDLKJW but I am receiving the following error
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\tutorial_php\tasks\task-7.3.2.php on line 169

Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\tutorial_php\tasks\task-7.3.2.php on line 181
now this is confusing because I am passing an array into it, thus surely it should be countable when I set the $this->datos to the array passed into it?
 
@Kwsswart It's very unlikely that PHP is wrong and more likely you're actually passing something other than an array to count :) Add a var_dump just above the count to see what you get.
 
thats whats confusing because it states it is null but I am passing the datos here
$datos = array(
    array('id' => 1, 'nombre' => 'Pedro', 'apellido' => 'Perez', 'correo' => 'pedroperez@mail.com'),
    array('id' => 2, 'nombre' => 'Juan', 'apellido' => 'Rodriguez', 'correo' => 'juanrodriguez@mail.com'),
    array('id' => 3, 'nombre' => 'Pablo', 'apellido' => 'Ramirez', 'correo' => 'pabloramirez@mail.com'),
    array('id' => 4, 'nombre' => 'María', 'apellido' => 'Manuit', 'correo' => 'mariamanuit@mail.com')
);
echo print_r($datos);

$headers = array('id', 'nombre', 'apellido', 'correo');
 
PHP reflection bug, PHP doesn't see the PHPDoc for the 2nd property. ・ Class/Object related ・ #80686
 
function _construct($datos, $headers = null){
        $this->datos = $datos;
        $this->headers = $headers;
    }
and assigned here
 
@Kwsswart Your _construct is missing a second _
 
4:23 PM
-_-
I know I was being stupid...
thanks man
 
4:50 PM
Where does the "Narrator" meme come from?
 
It's quite generic
 
It's not like a South Park reference that developed a mind of its own?
 
Ahhh... I figured it came from some TV show. Thanks!
 
How can asynchronous backend programming languages increase the speed of web applications when web applications are synchronous by nature? For example, people say node js is fast because it's asynchronous. How can that be important when all the http requests are synchronous by default?
 
5:06 PM
@X4748-IR If the web app is just computing a value and returning it, it can't. The async part comes in back-end IO, like DB queries.
If your app spends 60% of its time waiting for a database to return data, then async logic so it can work on some other request in the meantime can be very helpful. If your app spends 2% of its time waiting on the DB, your upper-bound of improvement is 2%, so it's probably not worth the hassle.
Tools like Node, ReactPHP, Swoole, etc. are helpful on IO-bound tasks. On CPU-bound tasks, they don't really give you much.
 
Thanks you. I do understand that part completely, but it seems people say because node js is async, it can handle multiple requests at a time! I don't understand the relationship.

1) You send a request to the web server
2) It gives it to the CGI
3) CGI give it to programming language
4) Programming language send the answer to CGI
5) CGI give the answer to the web server!

I don't understand what's the use of async except the I/O part
 
Node doesn't use CGI.
 
@Crell Hmmm
 
Node connects to the socket itself, with a single process, and then that ONE process handles all requests. That one process avoids blocking by doing all IO async, and chopping up longer-running processes into async chunks so they can interweave with other tasks.
There are pros and cons to that approach. Personally I hate it, but others disagree. :-)
 
@Crell Nice...
 
5:34 PM
@Crell As I understood it seems that the single process which you said, is asynchronous, and it executes processes in individual threads.
 
In Node/ReactPHP/etc, there are no threads. There is only one active execution at a time.
The idea is to keep that one execution working at all times rather than pausing and waiting on some remote process, but without using actual threads.
 
For now. M:N threads is the theoretically best (but most complex) solution.
 
M:N being what Go does, and what Rust has libraries to do.
 
@Crell Hmmm... So is it concurrent?
 
It's concurrent in that the different pieces of code could run in parallel, or out of order. They don't necessary DO.
The terminology is all wonky in this space. :-)
 
5:36 PM
@Crell +1 Hmmm. It's a bit tricky
 
It is. And frankly the Node implementation is especially bad.
 
hey anybody pls try this
 
Rust's is a lot better, because it's a lot easier to hide away from most code. The proposed Fibers RFC tries to do the same for PHP.
 
-1
Q: how can i make a pdf with table of all these input fields of a row and link each row with associate files(if any) using mysql and php

Đęĕpák ĞųpţąInput Form: Expect output: Itemnames: 1,2,3,4 (from the first column of the table) then table with all these column(listed in code) and suppose if i click over the browse and browse documents file name (fetched from database) then on the same pdf that will be hyperlink(with page number). <...

i tried many time with different method but no full solution yet. pls help!
 
6:22 PM
when you have a too old version of php-src on prod and upload new code … Invalid opcode 117/2/0. yay :-D
 
Has anyone done an analysis of the p95 and p99 on identifier lengths for PHP source code on Git Hub or something like that?
 
6:49 PM
@LeviMorrison What are these?
 
Sorry, I mean, 95%/99% of identifiers are less than what length?
 
Ah, don't think anyone did something like that no
 
7:20 PM
@Girgias Ok, btw intersting project ...
 
8:00 PM
@LeviMorrison why is that a useful metric, out of interest? not obvious to me what I could use that info for
@X4748-IR this approach is known as "co-operative multi-tasking", if you want to google for further reading
@ĐęĕpákĞųpţą wkhtmltopdf.org
 
 
1 hour later…
9:10 PM
@IluTov @Crell FWIW I think the fundamentals of your enum RFC looks reasonable, but adding non-static methods, extensions, interfaces etc is really puts me off.
 
Extensions?
 
Poor choice of words, I mean how it's extended what, imo, should be a relatively simple enum list, into something far-too-object-like for my comfort.
 
In practice, more languages do that than have dumb-constants. :-) There's ample use cases to justify them. Fortunately it all scales fairly gracefully so it's easy enough to ignore the bits you don't need.
 
Are all enums final? I only see mention of final in one of the examples
 
Yes.
 
9:26 PM
I'll likely vote for it. However, personally, I would want to see Nikic land object array keys first (or has that already been done?)
 
@DaveRandom If I make a static sized buffer of X bytes to hold an identifier, how often will I end up having to dynamically allocate memory because the identifier is > X bytes?
 
@MarkR It hasn't. I'm very skeptical about the long term implications of that. I don't know how I'd vote on it at the moment, though I certainly can understand the appeal.
 
9:43 PM
Oh? How so. Seems like it would be a perfect fit for enums in place of the const's that ae used now
 
10:36 PM
I'm getting confused. I've always believed a controller to be a class containing 1 or more actions methods. Now I'm finding some places refer to the action method as being the controller. Is a controller a callable, or the class that contains the callable?
Of course in the instance of an invokable class it would be both a class and a callable
 
One single thing to handle per controller (or whetever you call it) is much easier to maintain
 
Right, but aside from good practice, I'm moreso talking about definition
 
s/controller/class/ and it makes more sense
 
For example...
 
In terms of definition: forget about the terms: controller, model and view
 
10:39 PM
class UserController
{
    public function index() { ... }
    public function create() { ... }
}
Is that two controllers
 
Yas
Forgot about MVC (or whatever term coined)
Focus on SRP
 
Yes, I agree with having 1 action per controller class
 
Rendering users is a different responsibility as creating a user
 
Right, I was just reading a discussion where two people were debating the definition of a controller, and when I googled it I saw conflicting definitions
Good to know though
 
Yea if you are following whatever is left of the MVC cult (or rather a specific interpretation of it) you would get that
Really though
Drop the term MVC in any form
And think about sane architecture
 
10:43 PM
haha okay good to know
 
Same rules apply. MVC just muddies the water
muddies? Is dat a word?
 
Muddles
But same thing :p
 
Aye that one
In my experience. If you throw "MVC" at any problem people stop to think and say I need a class called SomethingController, SomethingModel and SomethingView
If they even think about SomethingView
 
I am pretty used to using MVC architecture, but since I mostly create APIs the view is just an API response. Do you have any suggestions on content I could read that offers alternatives?
 
@scorgn meh. use a more powerful dependency injector.
Also muddling, that Peehaa may be more expert in.
 
10:46 PM
@Danack Now I'm intrigued
 
Risky click?
Going for it!
OK. muddles GOT IT!
Now I want a baseball bat to force my cocktails into existence
 
I don't usually follow MVC architecture intentionally but I always have controllers and models defined, even though there's not always a controller for each model or model for each controller.
 
@scorgn my understanding is that quite a few frameworks only support dependency injection in the constructor. They can't pass in stuff per method. Which means that if one method of a class needs a FooReader, but the other methods don't, it means that there is stuff that is set in the class that is only used by a few methods.
So, instead of making their DI more powerful, they said "best practice is one action/method per controller"
I have a library for using Auryn with Slim here: github.com/Danack/SlimAurynInvoker
 
Off-topic: anybody among us?
Ekin and I are ready for stabby stabby
 
well now we know who the two imposers will be :P
 
10:51 PM
Red is sus AF though!
You up for a game Mark?
 
@Danack The thing that I like about putting them in the constructor is that class scope creep becomes visible pretty fast, but in the past there's definitely times where I pulled services from a service container outside of a constructor because it was only needed for that one method
I would be up for it but I don't have a windows computer anymore :(
 
@PeeHaa I've never actually played it ._.
 
Do you have the game?
 
nupe. its on steam I guess?
 
@scorgn I think t supports macs?
@MarkR aye
 
10:52 PM
it's on mobile devices
 
@PeeHaa I don't think so, it didn't last time we all played
 
are you playing? :O
 
Yes
 
I know it's supposed to be coming out for mac
it's on Switch :P
 
One quick round maybe
 
10:53 PM
I have a switch actually I didn't know it was on there
 
For people on steam. I can totes get it for you
Sponsored by Tiff and Statik :D
 
@scorgn it was a recent port
lol
 
Pay it forward I guess
:D
FWIW I would prefer to stab @Danack like a motherfucker :P
 
:O
monster
 
Nothing personal
Just stabby stabby stabby stabby stabby
 
10:56 PM
$peehaa->stab();
 
What are you playing?
 
Among Us
 
@Trowski is in
 
code?
 
ThW
@Tiffany the method is missing a target argument :-)
 
10:57 PM
Not in yet
@ThW $yourMother?
 
$tiffany->stab($peehaa) seems like a better API.
 
@Trowski Ask @Crell... You need a monad!
MAYBE STAB PEEHAA?!
 
@DaveRandom HEY WHAT ARE YOU DOING
how many do we have...
 
At least 3 :D
 
No Mac version it seems.
 
11:02 PM
mobile and switch version though!
 
Maybe because it's Epic games, weren't they having a bit of a disagreement?
 
> On PC, mobile, Nintendo Switch & soon Xbox
hey, they use PHP innersloth.com/gameAmongUs.php :D
 
ThW
Finally! My EOS node extension triggers a item request transfer without crashing. Time for a party...
 
11:24 PM
@Danack This seems a bit similar to how Laravel does their controllers/requests/responses
I don't know if you want to hear that though :p
 

« first day (3758 days earlier)      last day (1176 days later) »