« first day (2046 days earlier)      last day (2901 days later) » 

1:01 PM
Hey @Joe do you think it would be fine if we go into voting now with "callable types", adding design for Reflection API but not implementation? (I have a shit ton of work right now, so making changes for Reflection is not a problem by itself but it's just a matter of time for me)
 
yep, fine
 
alright, thanks
 
@JoeWatkins Hey Sir can you be my tutor ?? I know this will give you no pleasure but i will help me a lot to build my career :)
 
you won't learn much by listening to one person ... I can be wrong, always am ... if you have questions ask them, I'll offer an answer when I'm able, but so will others, and they are often better :)
 
I know there are so many talented people but if you or anyone have time , can leave me tasks i will complete them and try to learn fast and well. I know it will be a hard journey But i will give my 400% potential i promise you guys. :)
 
1:10 PM
@PraveenKumar There is a PHP mentoring programme
 
@bwoebi gotta go afk because taxi service, commit whatever seems good to you ... I'll be back as soon as I can be ... thank you, again ...
 
@JoeWatkins yea, no problems
 
There is a PHP function something like "evil()" which rounds the number. Anybody knows what's that function?
7
 
thank you
 
1:14 PM
@Shafizadeh ceil always rounds up, floor always rounds down, round is normal rules for rounding.
 
@MattPrelude nice .. got it
 
I know php been working for almost 1 year but never learned a single new thing always that same code i have to write they give me designs and i implement them... Thats all i know. Although from my-side i am very fast but keep loosing from others and i am concerned about my career now GIve me any type of task i will try to complete tasks. Thanks before hand
 
@PraveenKumar clean the car.. wax on. wax off.
 
@PraveenKumar Look for 'php code kata'
 
1:17 PM
@PraveenKumar You should challenge yourself to learn something new every few months or so. Try a new framework you've not used before, try coding something you've never done before and that challenges you. Keep expanding your knowledge.
There are also a lot of "coding challenges" out there that throw problems and you and they get harder and harder to solve.
 
or go through the issue trackers of some open source projects and try to fix some bugs
 
Also, always a good idea :)
@PraveenKumar hackerrank.com/domains something like that. Allows PHP solutions and covers various topics.
 
@MattPrelude first link to laracasts
with fizzbuzz kata using laravel
 
@PraveenKumar Writing unit tests for @Jeeves is something you will learn from :P
 
anyone know how to access a unix socket in a docker container from the host?
 
1:21 PM
@PeeHaa Nice... :D
 
But i think contributing in someone's live project(without sharing details can work on modules) will help me alot.
@Gordon thats a really nice idea( issue trackers of some open source projects and try to fix some bugs).
@Oldskool I tried hakerrank they keep giving me algorithms (I think web development does not require such skills but correct me if i am wrong).
@PeeHaa I know nothing about Jeevas
@MattPrelude diving in it
 
@PraveenKumar There are also non-algorithm topics available. But this is just one of many examples, there's more services like this out there.
 
@SergeyTelshevsky oh pls god no. why would someone want to do fizzbuzz in laravel?
 
Jeevas @Jeeves your new name :P
 
@Oldskool geeksforgeeks is also same just came across these 2 only....will be searching for more. I am really good with javascript + jquery + html+ css + codeigniter(Favorite one) + laravel(one project modification only) + Python (trying to learn)
 
1:32 PM
@Gordon Needs more jQuery
 
Jeevas @Jeeves paro
@AnmolRaghuvanshiVersion2.0 nothing happened
@Jeeves paro
 
@AnmolRaghuvanshiVersion2.0 how this works ?? and what is on that github page It is showing me code changes
 
1:43 PM
@Oldskool ;-)
 
Wes
'noon
 
@Gordon yeah, I know there's a jQuery plugin for that
@Gordon like a go-to solution
@Gordon did that on some interview and the interviewer (some senior in a company known across europe) couldn't understand how it works
 
Wes
1:59 PM
is there a way to have a method linked to its tests somehow in phpstorm? something like "jump to test" kind of function...
 
@Wes There is, it should recoginze the test class automatically if you setup your test directory.
 
Wes
the test directory is marked as test dir root, yeah, but no link
 
@Wes ctrl-shift-t
 
Open the class, then use Cmd-shift-T / Ctrl-shift-T yes.
Should open a popup, something like this: i.imgur.com/j7JcVYn.png
 
Wes
i don't get that
 
2:04 PM
Your cursor has to be on or in the class you want to find the test for though. So if your cursor is on the docblock it doesn't work.
(Because there could be multiple classes in 1 file).
 
good morning
Have a question about middleware.... why is it called middleware when it's concern is doing pre and post request processing... wouldn't outerware be more accurate?
 
Wes
ah, the file name must match @Oldskool how stupid -__-
 
@Wes It is common practice to call it MyClassTest.php, yes.
 
Hello, is it possible to force a .mp4 download on iphone safari?
When i try a script that downloads on my macbook , it just opens it up in safaris player, but instead I want the .mp4 file downlaoded onto the phone so it can be viewed in the iphones video player instead
 
@MatthewSmart Might want to send the content type to application/octet-stream
 
2:11 PM
@orangepill, this will force it to download on my phone?
 
@Orangepill eeeew
 
Wes
@Oldskool will try to fix. is there another way to get that popup open? ctrl+shift+t requires two hands, or a very big one
 
@PeeHaa alternative?
 
@MatthewSmart what does your code look like?
 
well im using laravel
and i use a function like - return response()->download($file);
but prior to developing the app in laravel, i did do some testing on static php
 
2:13 PM
Oh sorry. No idea about laravel
 
@Wes You can change any key mapping in PhpStorm, so yes.
 
but i cannot remember if it worked on iphone or not, just grabbed it from stackoverflow
 
@Orangepill content-disposition
 
content-disposition?
 
@Wes Open your preferences, go to Keymap. Then it's under Main menu > Navigate > Test.
 
Wes
2:14 PM
yes just found out :D thanks
 
@peehaa my experience is that it still tries to open it instead of opening file dialog
 
stackoverflow.com/questions/4624012/… something like the first answer on here?
 
maybe PHP should expose some of its internal functions directly to userland
 
@MatthewSmart something like that has worked for me in the past
 
and it always you to download a .mp4 video to the users iphone video folder?
 
2:18 PM
$type = is_numeric_string_ex($str, $lval, $dval, -1, $oflow_info);, anyone?
 
Anonymous
jollow
 
or it might be better as just int|float|null is_numeric_string_ex(string $str, int $allow_errors, &$oflow_info);
 
@Andrea I realise you are extracting the michael here, but this morning @SergeyTelshevsky came across something that actually would be good to expose to userland, and that is a way to access EG(exit_status). At the moment there's no way to get the value that was passed to exit(int) in a register_shutdown_function() callback, and it might also potentially be useful to be able to set the exit code without actually exiting (like you can set the HTTP response code without bailing).
 
2:34 PM
@DaveRandom interesting…
also I wasn't joking
 
or at least get some magical constant or call some function inside the callback, though it's pretty stupid..
 
is_numeric_string_ex's API is horrible but it might be handy if you could use it directly, rather than through one of our many crappy overlapping subsets of its functionality we directly export
 
@JoeWatkins now numbers are back to normal
 
if nothing else we could add proper tests for it that way :)
 
@bwoebi For the functions accepting arrays of Awaitables, maybe the signatures should be func(Awaitable ...$awaitables) instead of func(array $awaitables)?
 
2:37 PM
@Trowski no, that'd mean we'd have to expand arrays
that's not going to be cheap
 
@bwoebi Yeah, good point, usually the awaitables are in an array to start.
 
yep
 
Just means I have to manually check the entire array first.
 
@Trowski or you can trust it and get an Error from engine
 
With PHP 7 that's a more acceptable way. Did we ever reach a consensus on requiring 7 for Amp v2?
 
2:48 PM
@Trowski … or get a fatal error, whatever pleases you :-D
 
@bwoebi Fatal errors displease me :-P
 
Bobs-MacBook-Pro-2:php-src-krakjoe bob$ ./sapi/cli/php t.php
empty_loop         0.420
write_prop1()      0.819    0.399
write_prop2()      0.811    0.391
write_prop3()      0.808    0.388
------------------------
Total              2.859
@JoeWatkins ^ perf got normal again
(I admit, I cheated, because I optimized constant assignments)
@JoeWatkins ping please when you're back
 
How difficult would it be to unreserve print for method names? This one is annoying.
 
@LeviMorrison very.
 
3:01 PM
because print($foo); is just as valid as print $foo;
 
Adi
can someone help me please with my codes
it keeps giving me a false result in isset($_POST['submit'])
 
Adi
$get = isset($_GET['id']) ? $_GET['id'] : "";
$query = "SELECT * FROM `crew_info` WHERE `id` = '$get'";
$query_run = mysqli_query($conn,$query);

if(isset($_POST['submit'])) {

$query_update = "UPDATE `crew_info` SET `crew_status` = 'NEW' WHERE `id` = '$get'";
if ($query_update_run = mysqli_query($conn,$query_update)) {

echo 'Crew Accepted';
}

}
echo '<!DOCTYPE html>
<html>
<head>
<title>Review Crew</title>
</head>
<body>
<form action="review.php" method="POST">

<table border="2" align="center" width="600" cellspacing="3" cellpadding="4">
 
@Levi there's not much possibility to unreserve most keywords
@Trowski anyway, may you please remove the Awaitable subnamespace?
 
o/
 
3:03 PM
What if we allowed all function calls to omit parenthesis? :D
 
@bwoebi Should we do that in the loop package as well?
 
@LeviMorrison /me runs away, screaming.
 
Wes
@LeviMorrison had a similar idea the other day. iirc python does that, right?
 
@Trowski you never directly use the loop package classes except to eventually set the factory … so, no, not worth it.
but you heavily access amp primitives…
 
Wes
for example, $foo->foo = $stuff; === $foo->foo($stuff);
 
3:05 PM
Guido (main author of Python) wishes that print wasn't a reserved word as well.
 
Adi
help me guys haha
 
@bwoebi So just the Awaitable and Observable packages would be in the Amp namespace?
 
probably
@Trowski what's current state on your observables?
 
Wes
anyway, idk, i'd expect $foo->method to return me a callable of the method bound to $foo, rather than actually calling the method. why you want to do that though?
 
@bwoebi Just about ready. I'm sure there will be some changes we'll make afterwards. :-D
 
3:07 PM
are you guys having any problem loading github?
 
@Trowski Looking forward to see it pushed then…
just github being down for me currently :s
 
mine too.. :(
 
Adi
can someone help me here?
 
@Adi a) format your code & b) make it a question if you're not getting replies here :) people may bother more for rep. :D
@Adi And stop feeding a GET variable straight into a query. I said this 2x today already, your software is dangerous.
@Adi Read this and stop putting your clients' / users' data at risk.
 
Adi
3:16 PM
@MattPrelude 'UPDATE crew_info SET crew_status = 'NEW' WHERE id = ?'
@MattPrelude is this correct for update query?
 
@Adi Yes, the important bit is just not to put a variable in the query direct. Instead you use bound parameters so SQL can escape it properly for you.
 
Adi
one thing, i got an error in my update query because of the 'NEW'
 
Adi
@MattPrelude this is my isset codes, where should i put the mysqli_stmt_blind_param?
 
@Orangepill That's... horrible
 
3:20 PM
> Minor service outage.
 
Damn browser
 
@Adi You bind params after you do prepare
prepare, then bind, then execute
 
Adi
please check this
@MattPrelude is this correct?

$query_update = 'UPDATE crew_info SET crew_status = 'NEW' WHERE id = ?';
if ($query_update_run = mysqli_prepare($conn,$query_update)) {
mysqli_stmt_bind_param($query_update, 's');

echo 'Crew Accepted';
}

}
 
$query_update = 'UPDATE crew_info SET crew_status = 'NEW' WHERE id = ?';
You are using single quotes around the query
And then single quotes around 'NEW'
PHP sees this as a string
'UPDATE crew_info SET crew_status = '
 
Adi
@MattPrelude is my if statement correct?
 
3:22 PM
And then it wonders why you put a bareword next.
You need to either escape the quotes around NEW or use double quotes around the query
The if statement is wrong
 
Adi
i used double quotation
i get an unlimited tables because of while loop @MattPrelude
 
$query_update = "UPDATE `crew_info` SET `crew_status`='NEW' WHERE `id` = ?";
$stmt = mysqli_prepare($conn, $query_update);
mysqli_stmt_bind_param($stmt, 's', $_GET['id']);
mysqli_stmt_execute($stmt);
That would be the procedural way to do this
Then
 
`You` `sure` `love` `your` `backticks` :)
 
if (0 !== mysqli_stmt_affected_rows($stmt)) {
    echo "Crew update accepted";
} else {
    ... failure case ...
}
@PeeHaa I find it makes queries easier to read :P
@Adi Don't just copy-paste that, read the docs and understand how and why it works.
 
Adi
yes im trying to understand it @MattPrelude
 
3:28 PM
Then ideally rewrite it as OO, because procedural mysqli will make babies cry
The procedural only exists to make it easier for mysql_ users to switch, really.
 
Adi
@MattPrelude is that okay? i have 2 $stmt variables? one for select query and one for update query
 
@Adi I suggest calling them different things
is not a fan of variable reuse
 
Adi
why my while loop always gives me unlimited tables? @MattPrelude
 
@MattPrelude s/OO/PDO s/procedural/
 
3:30 PM
@PeeHaa I don't presume to have a great reason for people to use PDO, so I dont tell them to :)
@PeeHaa Personally I'm not using MySQL at all
 
Adi
is that okay to you to check my whole code @MattPrelude?
 
@AnmolRaghuvanshiVersion2.0 :) haai
 
@MattPrelude mysqli_stmt_bind_param($stmt, 'ssssiiibbbllmmkkkffdduuet%$%@#', $_GET['id'], [&$...]); is a good reason not to like it :P
 
Adi
i always get unlimited output of tables with this codes:

if (@$_SESSION['username']) {
$query = 'SELECT * FROM `crew_info` WHERE `id` = ?';
$stmt = mysqli_prepare($conn, $query);
mysqli_stmt_bind_param($stmt, 'i', $_GET['id']);

if(isset($_POST['submit'])) {


$query_update = "UPDATE `crew_info` SET `crew_status`='NEW' WHERE `id` = ?";
$stmt2 = mysqli_prepare($conn, $query_update);
mysqli_stmt_bind_param($stmt2, 'i', $_GET['id']);
mysqli_stmt_execute($stmt2);

if (0 !== mysqli_stmt_affected_rows($stmt2)) {
 
3:37 PM
@PeeHaa It has OOP. But yes, named parameters would be nice.
 
How you have to pass the type is also somewhat krazy :)
 
Adi
@MattPrelude now i get an logical error in the while loop. it gives me unlimited table
 
References are generally bad
 
0 !== mysqli_stmt_affected_rows($stmt2) is that even valid
 
Adi
3:48 PM
i dont even know what is the problem of this line of code
while($record = mysqli_stmt_execute($stmt))
 
a.k.a. yoda conditions a.k.a. hipster programming
 
mogorin
 
this feels like a duplicate
 
3:53 PM
> Note: I am using the thin model fat controller approach because that's how code igniter seem to implement models.
Sounds about right
@AnmolRaghuvanshiVersion2.0 Yoda programming supposedly solves the case of typos where you forget to add 2 = and just do 1
 
http://2.bp.blogspot.com/-M61Y-VuCCSM/TtIQMTYPNrI/AAAAAAAAAGM/YtTOGRknF1s/s1600/yoda-conditions.jpg ()
 
// So

if ($foo = 4) { // whoops, PHP won't see that as an error.

// Becomes

if (4 = $foo) { // that's an error, and PHP would mark it as such.
 
you hipster
 
@Jeeves I'm totally fixing that, but it isn't the easy fix I was hoping for :(
 
Wes
3:57 PM
@MadaraUchiha must be noted that the last time i wrote = instead of == by accident, i was in 20th century
 
@Wes I always use === anyway
So It's very rare for me to mistake === for =
 
Wes
indeed, same here
 
Also, the mental "WUT" you're having when reading yoda code is not worth the possible bug detection.
At least for me
 
@MadaraUchiha but it's unreadable and mathematically wrong too..
 
Wes
@MadaraUchiha indeed
 
3:59 PM
@AnmolRaghuvanshiVersion2.0 Keep reading :)
 
Wes
java is filled with that though. you must love that :D
 
Wes
every java code i read has variable names of one letter only, and conditionals with yoda operands
it's a pain in the neck to read...
 
:P MadaraUchiha
 
@Wes Honestly, you don't see that here
 
Wes
yeah, got to be subjective (thankfully)
 
Adi
4:04 PM
can anyone tell me what is wrong with this?
$query = "SELECT * FROM `crew_info` WHERE `id` = ?";
$stmt = mysqli_prepare($conn, $query);
mysqli_stmt_bind_param($stmt, 'i', $_GET['id']);
 
@Adi You aren't executing the query? Other than that, looks good to me.
 
Adi
@MadaraUchiha here is where i execute the query
        while($record = mysqli_stmt_execute($stmt)) {
        echo "<tr>";
        echo "<th>".$record['first_name']."</th>";
        echo "<th>".$record['middle_name']."</th>";
        echo "<th>".$record['last_name']."</th>";
        echo "<th>".$record['date_added']."</th>";
        echo "<th>".$record['crew_status']."</th>";
        echo '</tr>';
}
 
@Adi That's not how you execute a query, IIRC
 
!!docs mysqli_stmt_execute
 
[ mysqli_execute() ] Alias for mysqli_stmt_execute()
 
4:07 PM
I haven't touched mysqli in a while, but aren't you supposed to execute once and then fetch the results multiple times?
 
Check the docs @Adi
And the return values in specific
 
Adi
this the first time i use it. matt prelude teach that to me here
 
> Note:
When using mysqli_stmt_execute(), the mysqli_stmt_fetch() function must be used to fetch the data prior to performing any additional queries.
@Adi when you learn a new function, read the manual entry about it.
PHP is one of the only languages with a really good documentation
Make use of that.
 
Adi
so this is the reason why i get an output of unlimited tables?
while($record = mysqli_stmt_execute($stmt))
 
!!mdn array.from
 
4:11 PM
[ Array.from() ] The Array.from() method creates a new Array instance from an array-like or iterable object.
 
TIL
Oh IE...
 
use of !!mdn \o/
 
Adi
im a beginner in PHP sorry i dont understand most of your comments guys :(
 
Yeah I think it was still a virgin :P
 
@PeeHaa got a sec to try something for me?
 
4:14 PM
Jesus christ. Mr bad timing... I am just about to get out. :P Sorry. Will be back in an hour or so
 
> git clone git@github.com:/amphp/pgsql.git && cd pgsql && git branch -va
^ can someone run that for me and paste the output?
 
From server / local?
 
anywhere
 
git clone git@github.com:/amphp/pgsql.git && git branch -va
didn;t work
 
I thnk github UI is broken but need to double check
@PeeHaa in what way?
 
4:15 PM
Sorry I'm really out now. @Saitama help that ^ guy
 
oh wait
 
@DaveRandom I was trolling... :)
 
ah k
:-P
 
:'D
 
I really have to go, I'm late, will just have to trust that github is broken
 
4:17 PM
github really is broken
 
Adi
@Saitama can you help me with this one?
while($record = mysqli_stmt_fetch($stmt))
 
I am actually not familiar with mysqli, actually...
 
Wes
@Shafizadeh do you get why they are called "ceil" and "floor"? :P lol'd at evil()
 
:P
 
Adi
@Saitama thank you anyways :)
 
4:23 PM
:)
 
Wes
especially spaghetti, my god i love php sauce spaghetti
 
Adi
@wes are you familiar with mysqli ?
 
Wes
no one is
 
Adi
why?
 
4:31 PM
plz don't ping everyone for help @Adi
 
PDO FTW
 
Wes
^ that
 
Adi
i see. haha thanks :)
 
@Wes not really ..! I just knew there is a php function something like "evil" with rounds up ;-)
 
@bwoebi ping
 
4:41 PM
@JoeWatkins pong
 
@bwoebi ping
 
We really need to avoid consistent checks on getting
 
Wes
@Shafizadeh room = the integer. ceil = room's ceiling. floor = room's floor
 
yeah, that's what dmitry is saying now also ...
 
Yeah, I've been talking with him this afternoon too
 
4:43 PM
but we'll do that, and he'll say there's some other problem ... he doesn't want the feature for some reason ...
 
@Wes :)
 
I've cleaned up a bit to avoid checks and using cache more extensively
@JoeWatkins he said he likes the feature, it just needs to have barely any impact
We just really need to get rid of these checks as far as possible (i.e. squeeze it all in the IS_UNDEF case and then do a property validity check)
(As we anyway need to check for IS_UNDEF)
for write access, I've already optimized out what I can
and it now should typically just go to cache (which is anyway in L1 data cache then on most writes because cache_slot is anyway accessed for property storing)
I see about 1.4 times slowdown for assignment to a typed property vs untyped. That's fine (the typechecking after all has some overhead)
 
eliminating the check on read isn't so simple, how do you check for uninitialized ?
 
> (i.e. squeeze it all in the IS_UNDEF case and then do a property validity check)
 
I'm not sure what you mean by that
 
4:50 PM
because we anyway need to check IS_UNDEF currently
as unset()'ing properties is possible and currently goes into a branch about undefined property
 
if you have ideas, run with them ...
I'll have a crack tomorrow, if you haven't ...
 
@JoeWatkins can we just assume that read/write_property can do property validity checks themselves?
 
you mean type check ?
 
yes
 
well ... it might be better to introduce a new handler dmitry was saying ...
 
4:55 PM
fwiw @DaveRandom it seems to be working again
> * master 9afd688 initial commit
remotes/origin/HEAD -> origin/master
remotes/origin/master 9afd688 initial commit
remotes/origin/new-api bc260f3 New API skeleton + some implementation
 
that may be nicer ... and just implement the default for std_object_handlers ...
 
@JoeWatkins a new handler? doing what?
 
You know. Handling things
 
the same thing as it's doing now, dmitry commented on the patch somewhere about it, I think
is that what he's saying ?
I think we can assume read/write does verify, so long as the verify function is exported
 
nope. He means we shall update the handlers directly where it needs it
 
4:57 PM
@JoeWatkins I think he's more saying that any other handlers (we ship) for which this applies should be modified
 
yep
 
and moin Nikita :-)
 
For most handlers it's probably not a problem anyway
@bwoebi "moin"
 
damn, these quotes made me laugh way too much
@JoeWatkins And I was suggesting the same
 
4:59 PM
yeah gotcha now
 
Are you currently working on it, else I'll do it
 
please do it
!!rfcs
 
I was writing a grammar in Lemon and the first thing I get is an assertion failed >.<
(in lemon)
 
> I'm gonna have my engineers invent a combustible lemon, that BURNS YOUR HOUSE DOWN!
 
5:13 PM
@bwoebi LSP checks are not affected by strict/weak
I don't think they should be in this case either
 
@NikiC he's doing some variance here, so I'm asking as it's new.
I'm more asking for clarification than actually expecting that it should be done that way ;-)
 
It would be extremely horrible if done that way ^^
 
I somewhat agree^^
 
5:35 PM
How can I replace spaces with plus + in the URL? should I use JS or there is another approach?
 
Adi
is that possible to echo a printf?

this is what im talking about
echo "<th>".printf("%s %s %s<br>", $col2,$col3,$col4)."</th>";
 
@Joe I'll continue later, real life is calling :-D
 
@bwoebi cool, bit of same for me also :)
 
Anyone here knows probability theory?
 
5:51 PM
lol
 
theoretically :D (which means: no)
 
I have a theoretical question :P
 
But what do you want to know?
 
My question is pretty basic. I have three random variables A B and C - I know COV(A,B) and COV(B,C) (and the correlation too), I need to say something about COV(A,C) without actually calculating it.
 
5:58 PM
The answer probably begins with "It is simple to show that…"
 
@BenjaminGruenbaum I don't think you can really say much
 
can you prove it?
 
Or, I'm not sure what you're looking for. E.g. if COV(A,B) = 0 and COV(B,C) = 0, that does not imply COV(A,C)=0 (e.g. A=C)
so you don't even get a triangle inequality or something like that
 
Right, it's not transitive
in JavaScript, 12 mins ago, by Benjamin Gruenbaum
@JanDvorak You can't, counterexample: a,b,c are real valued independent random variables, let x = a - b, y = b - c and z = c - a, x and y are positively correlated and so are y and z but x and z are negatively correlated.
 
@BenjaminGruenbaum what kind of result are you hoping/looking for?
 
6:13 PM
This is an extremely broad question.. but if I had a HTML page like this: <p>1</p> <p>56</p> <p>2</p> <p>78</p> is there a way to order them from highest to lowest?
 
@TheCodesee In JavaScript or PHP ? If PHP, just sort() your array before iterating on it.
 
@MorganTouvereyQuilling It's not really an array (or at-least I don't think so)... I'm getting numbers from a JSON file and displaying them in a foreach loop
 
user895378
@Trowski getAwaitable() ... this is one nice thing about "promise" ... because it can act as the verb for Deferred::promise() and the noun for Promise ... count me as still preferring Promise to Awaitable ... (I realize that ship has sailed, though).
 
@TheCodesee Then you have a PHP array somewhere, yes :)
 
6:31 PM
@rdlowrey Technically, this ship has only sailed for the standard, not our naming. :D
But yes, it's the same thing I said about ->promise().
 
hey guys, we are a bunch of developers and have developer chat plugin for web github.com/AppLozic/Applozic-Web-Plugin would love to get the feedback from the group
 
@DevashishMamgain Wrong room.
 
@kelunik sorry, was posting it to a different room, thanks for notifying
 
@DevashishMamgain Looks like a pita to maintain btw
2300+ lines js blob
 
@rdlowrey Thus it's why I'd even prefer just get() over "getAwaitable"
 
6:45 PM
Can someone help with this such simple script? When the user clicks submit, the number increases from 1 to 2. However when they click submit again, it stays on 2 (instead of going to 3)
<?php
$page = '1';

if(isset($_POST['more'])) {
$page++;
}

echo $page;
?>

<form method="post">
<input type="submit" name="more">
</form>
 
There's no action in the form tag. And I would use a hidden field instead of a submit button
 
You have to persist your counter in a session (http://php.net/manual/en/session.examples.basic.php). Without that, the value of $page is lost after a request (the PHP processus dies so memory is cleared).
Plus, please do `$page = 1` instead of `$page = '1'`, the latter is a string.
 
@JoeWatkins Zend/tests/type_declarations/typed_properties_009.phpt was bogus btw. It must return int(0) and not error as we have __get() returning NULL here. (weak casting rules)
 
@Machavity When there is no action attribute, the form sends the data to the same page.
 
@MorganTouvereyQuilling It's still sloppy to do it that way
 
6:51 PM
@Joe just as well as test 036 … which just should not yield the object value (as it's undef)
 
@Machavity I agree, but that's not the problem here, and, I prefer a missing action attribute than a counter initialized with a string xD
@TheCodesee That's the second time you post a very basic question, I suggest you to read some tutorials for beginners instead of asking that here, we're not an hotline :)
 
@MorganTouvereyQuilling hehe "second"
 

« first day (2046 days earlier)      last day (2901 days later) »