« first day (2743 days earlier)      last day (2219 days later) » 

12:07 AM
v for variable?
 
vendetta
 
12:19 AM
I think the idea was v for scalar, a for arrays, s for when the value comes from $_SESSION and ss when the other was already taken
the thing with that, is that after a while of being in it, I was almost to the point where I was not finding it horrible anymore
 
I am pleased to announce that my request to implement Covariant Return Types and Contravariant Parameter Types as a special project for university credit has been approved!
14
 
\o/
congratulations!
 
Thank you!
 
@FélixGagnon-Grenier didn't Atwood blog about something like this?
 
@Danack damn dude, yes exactly that
i mean, if you write spaghetti, it's not a horrible idea
i'd much rather have a clear separation between "domain" (assume sanity) and "application" (assume insanity) than variable prefixing, but otherwise i like it
 
The point about coding style conventions is explored in Code Complete; a good style convention makes bad code look bad, not every code look good.
 
totally
 
1:30 AM
Note section is not relevant anymore – #76242
 
 
1 hour later…
2:41 AM
Hi Guys...
I have a quick question on php GD library
I did install GD. When I searched for its status using php -i | grep -i gd
it is showing GD Support => enabled. But it is not working. Still getting same error in site. I did apache restart after installation too.
Any idea on this?
And it is showing gd.jpeg_ignore_warning => 1 => 1
 
 
1 hour later…
3:51 AM
'nin
 
morning!
is CodeIgniter is good for saas applications?
 
4:30 AM
morning
 
morning
 
5:01 AM
o/
 
posted on April 20, 2018

New Cyanide and Happiness Comic

 
5:23 AM
mornin
 
San
Hi all!
I'm new to Laravel
This I tried to test
// TypicodeInterface.php
namespace TypicodeManagement\Service\Typicode;

interface TypicodeInterface {
public function getPosts();
}


// TypicodeService.php
namespace TypicodeManagement\Service\Typicode\Laravel;

use GuzzleHttp\Client;
use TypicodeManagement\Service\Typicode\TypicodeInterface;

class TypicodeService implements TypicodeInterface {

/**
* Method to fetch all posts
*
*/
public function getPosts() {
}
}

// TypicodeServiceProvider.php
namespace TypicodeManagement\Service\Typicode;
 
Anybody please help me, how can I fix runtime error in php ext, it says undefined symbol: zend_object_alloc ??
 
San
These are my files I created, but I got this error: "Class TypicodeManagement\Service\Typicode\TypicodeInterface does not exist"
can anyone help me?
 
that has never been a symbol, it must be defined within the extension and maybe the compilation unit misses a header include
show me code ?
 
static zend_object *cl_object_new(zend_class_entry *class_type) /* {{{ */
{
	cl_obj *intern = zend_object_alloc(sizeof(cl_obj), class_type);

	zend_object_std_init(&intern->std, class_type);
	object_properties_init(&intern->std, class_type);
	// intern->std.handlers = &date_object_handlers_date;

	return &intern->std;
} /* }}} */
Generally I copied it from php_date.c
But I saw similar implementation in spl_array.c
 
5:26 AM
cl_obj *intern = ecalloc(1, sizeof(cl_obj) + zend_object_properties_size(class_type));
 
@JoeWatkins thanks, it goes further
 
you must set handlers
handlers must have offset set
 
Now I've got *Program received signal SIGSEGV, Segmentation fault.
0x000055555589042c in ?? ()* but I think it might be something else
 
Ok, thx a lot :)
 
5:29 AM
is zend_object at end of cl_obj ?
 
I'll play with that
Yes it is
typedef struct _cl_obj cl_obj;
struct _cl_obj {
	HashTable    *prefixes;
	zend_object   std;
};
 
declare zend_object_handlers cl_object_handlers;
in MINIT do
memcpy(&cl_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
cl_object_handlers.offset = XtOffsetOf(cl_obj, std);
in create_object do std.handlers = &cl_object_handlers;
 
And I also copied and changed this but I dunno what for
static inline cl_obj *cl_obj_from_obj(zend_object *obj) {
	return (cl_obj*)((char*)(obj) - XtOffsetOf(cl_obj, std));
}

#define Z_CLOBJECT_P(zv)  cl_obj_from_obj(Z_OBJ_P((zv)))
 
yeah this is because Z_OBJ_P() is zend_object*, which you returned from create_object, that funny cast and calculation retrieves the base address of cl_obj from the addressof zend_object ...
 
I understand that I need this macro to get cl_object from zval
Ok, cool
Thank you
 
5:32 AM
the handlers and offset are needed because zend free's the memory you allocated as the base address of your custom object in create_object ...
you'll also need to set free_obj to destroy that hashtable, I hope, anyway ...
yw
 
ok, so it'll handle freeing without any additional impl if I just set an offset?
Ahhh ok I see
 
yes, it has to work that way, don't efree() in free_obj, destroy the table and call zend_object_std_dtor() at the end ...
 
Where can I find some good examples about how to play with HashTable's?
 
well if there's something like what you want to do in php-src, then in php-src is a good place to look ... if there's nothing like what you want to do, then study the zend_hash.h header which contains all the looping macros and typedefs so you can understand it's structure and how ze uses it ...
 
Cool, I don't expect for now that somebody will be interested about including to php-src, I'm playing with psr4, psr0,and map autoloaders implemented in C
It's just I feel like everybody uses those loaders but they are only impl in userland
 
5:37 AM
what do you hope to gain by implementing it internally ?
don't say speed ...
there is no remarkable difference between ze manipulating a hashtable with opcodes, and you doing it yourself in C, if you're going to use the same structure, and call as near as makes no difference the same routines, expect the same results ...
 
no not speed, fighting for 1ms or less has no sense
 
okay good
so what do you hope to gain then ?
 
I just wanted to play around try myself
 
ah cool, learning is fun :)
 
Yeah, I thought I can learn using HashTables I think it was the reason I started it.
Because there is some goal
and I have to learn HT then
 
5:41 AM
I'm not saying it's not possible to write it more efficiently, I'm not familiar with how autoloaders work internally, so I couldn't suggest a structure to use, but it's highly likely there is a structure you could use and code you could call to make it go faster than PHP does ... but people underestimate how fast PHP really is at executing code, it's extremely fast, pointless to try and compete with mostly ...
 
@brzuchal Hi @brzuchal Yes, it is messy and more without context. Just for saying, the problem was a really dummy one: I had a return and the "execution" ends there and the other part of the function obviously didn't work! Thanks for at least watch at my code
 
it's going to be mostly maps of strings I guess, well a hashtable is a good structure for that, but php's has all kinds of baggage with each allocation of a bucket to cater for zvals, you might find it worth it to implement your own generalised hashtable with much smaller buckets, you may not see any increase in speed (worth talking about) but may well see a decrease in memory consumption ...
 
@JoeWatkins wasn't thinking about a speed, popular loaders of psr don't change anymore i just wanted them as c ext so I don't need to load a loader and just got it available from the first line of phpcode
 
not only is php fast, but cpu's are also ridiculous ... there was a time when a few thousand instructions difference in a routine really mattered, but now, there's no human perceptible difference between 50 thousand instructions and 5 million ...
 
I'll try myself and will see if it works and how efficient it is.
 
5:50 AM
s/routine/program/
ha
 
@LuigiLopez I can suggest you to do the refactoring and maybe then you'll see what's wrong by yourself.
@JoeWatkins and I think that learning how to add some extra fields internally to the object can be a good start for some resources refactoring, am I correct?
 
yeah
 
6:19 AM
hey, return, returning by reference, php.net/manual/en/function.return.php
the third note right above the user comments
"You should never use parentheses around your return variable when returning by reference, as this will not work. You can only return variables by reference, not the result of a statement. If you use return ($a); then you're not returning a variable, but the result of the expression ($a) (which is, of course, the value of $a)."
<?php
function &one($param1) {
$a = $param1 * 2;
return $a;
}

function &two($param2) {
$b = $param2 * 2;
return ($b); //Parentheses around return variable
}

$_1 =&one(10);
echo $_1 . "</br>"; //outputs "20"

$_2 =&two(10);
echo $_2 . "</br>"; //outputs "20", the same thing
 
happy frydai
 
@brzuchal Thanks, I checked by my self. Now is working thanks God give the widsom ;)
 
@brzuchal I'll postulate that reading the file stats and reading from ram or loading from opcache will be far slower than your autoloader. It just isn't the bottleneck.
 
7:02 AM
@bwoebi You mean my autoloader might be even faster, yes?
If so we'll see, as I said I want to learn something which will help me to challenge removing some resource types from PHP later.
 
Hey, how do you display images in between text that you get from a database?
 
@KerrialBeckettNewham usually web browsers display images using HTML markup
 
7:19 AM
morns
 
mornin
 
morning
 
\o
 
hey guys i need some help on guzzlehttp, if someone available

how can i use shared cookie request once the page loaded so without logging back for every request is it possible to make single call for login and then reuse same client object for every future request for ajax etc
 
7:36 AM
@brzuchal Sure it may be faster than current autoloaders, but it won't make any significant difference, I assume
 
7:59 AM
mornin
 
neatnik Slang. a person who is extremely neat about surroundings, appearance, etc.
 
so, the new "Perfect Circle" album is out today:
 
Anonymous
morning
 
o/
 
moin
 
8:05 AM
!!dad
 
Why did Google Car switch from MD5 to SHA512? They wanted to reduce collisions.
 
\o
 
Is it any good?
 
@tereško Thanks for the tip :)
 
hi
Can someone answer my question please?
this is the link https://stackoverflow.com/questions/49933086/woocommerce-get-order-total-price-without-counting-add-fee-and-discounts
are you giving me down votes?
 
8:37 AM
mornings
 
o/
 
Anonymous
stackoverflow.com/a/1737903/4781925 how on earth does this have so many upvotes
 
Urgh, anything that starts with something like "try this", immediate dislike
Nice security there too :D
 
@tereško It hardly depends on the context ..
 
what? learning to read?
 
8:49 AM
Good morning humans.
 
@tereško Do you mean I have to lean to read English contexts?
@MikeM. o/
 
if you ever want to gain access to the all the programming-related literature, that has been published in past 50 years, you will have to learn to read
instead of just copy-pasting chunks of text in google and praying
 
Well I'm doing it (learning) ..
I'm following interchnage book
 
9:05 AM
moin
 
Anonymous
good morrow david
 
yo
 
o/
 
Is this: if(($attachmentData = $attachment->get_Rows($info)) !== false){ is commonly known as bad practice? A lot of times I am doing something like this, just would like to get your input on it,.
 
Assignments in conditions are generally considered bad practice, yes
 
9:08 AM
might be just me being lazy ...
 
@MikeM. I personally hate assignments in conditions. But still many people do it.
 
...but people still do it, all the time, and I don't always necessarily hate it
 
Do not worry about your code being verbose, let the compiler and optimiser do their jobs
 
I definitely prefer if(false !== $attachmentData = $attachment->get_Rows($info)) { though
 
Anonymous
god, you're gross
 
9:09 AM
Don't feed the trolls
 
@DaveRandom Why that?
 
I prefer !1 instead of false, tbh
 
Anonymous
probably a manc thing.
 
Yeah, and I prefer != instead of !==
 
saves keystrokes
 
9:11 AM
@Leigh I also do ~0 instead of -1 when I want an int with all bits set. People hate me for that as well.
 
No no, !== is faster, optimise by hand all the way
 
I've also been known to switch (true)
 
@mega6382 false == 0 ...
 
Anonymous
Just to confirm, the yoda was a troll?
 
no, I do occasionally do that
only for assignment-in-condition though
 
Anonymous
9:13 AM
screw you.
 
I didn't used to do it until I started working with C# a lot
 
@JayIsTooCommon His species is unknown
 
Anonymous
Also please re-send your number. I deleted it before I realised you were trolling
 
getting used to use (var = expr) {} made me much more comfortable with if (var = expr)
@JayIsTooCommon ?
 
Anonymous
just emphasising my dislike for yoda
 
9:16 AM
So you have skipped fear and anger, gone straight to hate? Next stop... suffering.
 
I feel like `(var = expr) {}` is more like `(var = expr) ? true : false`
However the last is very annoying how quite a lot people are using it...
One liners that go beyond 3 freaking screens ^^
 
ha, not clicking that
 
You don't need to :-) missing a laugh tho'
 
...VsfOS... it's a trap!
 
@MikeM. github.com/DaveRandom/json-prettifier/blob/… personally I find that totally OK.
Oct 5 '17 at 9:02, by DaveRandom
Well, I'd listen to your argument so you could try to change my mind, but then we'd both be wrong.
 
It's fine tho' it's just a personal thing as I rather talk about a value to be checked at, and in my opinion a value is placed in the end.

Just to stay in the programming defaults of doing `$var = $value` and not `$value = $var` so I want to overdue that instead to every location I work with, however I could see your point of view aswell such as: I want to see what the value shall be, if it's for E.G not working, I don't have to get to the end of the statement to know what it shall be.
 
9:38 AM
@DaveRandom I mean, you did learn from w3schools, so we can't blame you entirely
 
harsh toke, dude
 
@Leigh At some point I surely believe we all have read parts of w3schools.
 
Anonymous
@DaveRandom ah shit, you actually weren't trolling. What a state.
 
Today is the day for harsh tokes, man
 
oh lol, true
although you should really learn to roll, I guess
 
9:39 AM
I can't roll for shit, it's true.
 
weirdly it's one thing I'm really good at, despite being generally terrible at anything that requires fine motor control
 
They always come out banana shaped :D
Luckily it's only a social thing, so I rarely need to
 
you are being too rough with it, you only need to put pressure on the roach
I haven't done it for like 3 yrs so I might be terrible by now
 
Go for tabletop vape
Well, you, don't
 
tf is going on here?
 
9:43 AM
welcome to #php-underground
 
@mega6382 A conversation?
 
wait, this isn't IRC
 
Anonymous
@Leigh lol
 
Shit, it's the pigs. Cheese it!
 
Hey man, wanna buy some singletons?
 
9:47 AM
@Leigh Only if you can fill the stack :-)
 
have you got any yellow bentines?
 
I've got some purple elephants
brb, buying pill press...
 
phpills
 
@Leigh when looking at r/PHP, what you said does not actually sound like much of a joke
 
I'd take that conf swag, purple elephant stimulants... make it caffeine pills or something
 
9:49 AM
purple elephants sounds more like blotter
 
Have you read about the positive effects of microdosing? Apparently it makes you really productive
 
mysql 8 - new default_authentication_plugin – #76243
 
Wes
hodor
 
hodor
 
Wes
i need a cappuccino
 
9:54 AM
Ha, not clicking that either :P
 
@Wes Looks good, can't you bring a cup to me? In need of some cappuccino!
 
Wes
we add a bit of cocoa powder on top of the foam. makes it awesome
 
Are these Antistatic wrist straps any good?
 
Wes
that was a poor attempt
hey that's my video about cappuccino
 
Yeah, but the question is real though.
 
Wes
10:04 AM
:B
 
:P
Yeah, anyway I was just reading about assembling a new PC, and read at a lot of places to ground myself and the case before adding components. And some people recommended using a Antistatic wristband. so, I want to know are those any good.
 
Anonymous
Yeah, use them
 
Anonymous
keep the machine plugged in (when appropriate), use an anti static matt, and strap up
 
Yes they are.
We have tested a few of them in college and they *discharge* you.
 
K
 
10:11 AM
@tereško Can I send you an email about a non-programming topic?
 
@mega6382 just always touch the case/chassis of the PC before touching any of the components, and static won't be a problem.
 
Wes
i read strap on and i was confused
but not too confused
@mega6382 i never needed such thing. just be sure you discharge yourself before touching components
 
mkay
 
@Danack In my case I most likely forget doing that, while if the strap is long enough, and the products are close enough I do not need to take the strap off so I am most likely secured.
 
Wes
don't flex components, don't stab them with the screwdriver is much more important :B
 
10:18 AM
I love static, it's the only way I can get balloons to stick to my body
 
Wes
:B
 
Wait, you aren't supposed to bend PC Components?
 
Wes
@MikeM. when you are inserting the gpu in its slot, it's easy to bend the pcb
also slightly can break stuff
 
Morngins
 
Wes
of course you aren't supposed to bend components, but you don't do it on purpose :B
 
10:20 AM
@Wes Well I mean like, sometimes a ram module is just too big and then I bend it to fit the slot....
 
If you have a heavy GPU, getting a case with full sized card support is also a good idea (by that I mean one with a vertical post and an extra support to stop the weight of the card bending the PCI slot downwards)
 
Anonymous
yohaaa
 
Wes
hey peter banning
 
o/
 
Good afternoon @PeeHaa
 
10:21 AM
Oooh nice @LeviMorrison \o/
 
yo @PeeHaa
 
yo alls
 
Wes
@MikeM. :B that means you are trying to fit rambus in ddr3 :B
 
Anonymous
heh rambus.
 
Anonymous
10:23 AM
that's a funny word.
 
@Leigh Yeah, I have a great chassis in mind, corsair air 540
So, these things won't be a problem in that.
 
I was not all that impressed :P
 
:/
But its so big and has separate compartments for main components and wires and shit.
 
yes, it's very big (even thought you will not actually utilize all that sapce) with limited dust-proofing
and clean wiring does not need a lot of space
 
Yes, but I found a dust-filter kit for it.
Well it'll be my first build. so, there will be no "clean" wiring. :B
 
10:32 AM
:-)
 
Wes
hot air goes up and dissipates through the cabinet itself rather than a million air vents :B
do they make cabinets like that these days?
 
not that I know of
 
also it did not work as you think - the air would instead escape through the openings in the sides
@mega6382 when I look at this, I get worried about the video-card
 
@tereško But I saw a lot of benchmarks from verified youtube channels, and they all were really good, even with overclocking.
 
10:39 AM
which is why I said, that I am "worried" and not sure how it would work out
anyway, my only actual problem (aside from dustproofing) is taht it looks too ugly for my taste ad takes up a lot of room
 
The weather here is usually very hot in spring and summer, which is why I opted for this case, because it is optimized for cooling.
Well I don't really care about it being ugly.
BTW mu brother recommended this cougargaming.com/us/products/cases/conquer
 
Wes
@tereško not referring to that specific model. i'm saying full towers with the empty space at the top
gotta get cracking with work
 
Now here is something interesting, Joel Spolsky's blog is built with wordpress joelonsoftware.com
 
Anonymous
why is that interesting?
 
Oh, just cause of the general hatred towards wordpress by senior programmers
And I expected, he would have used .NET rather than PHP based solution.
 
11:07 AM
> Every Google Cloud Platform customer automatically gets Bronze support for free. Bronze support includes our product documentation, community support, and support for billing issue
 
Nice guys...
 
30 minute lunch breaks are way to short :-(
 
11:26 AM
@mega6382 joelonsoftware.com/2016/12/09/rip-citydesk That's the post about switching over.
 
> Matt Mullenweg over at WordPress has been trying to get me to move Joel on Software over to WordPress for so long it’s not even funny. I finally gave in.
 
So create some blogging software.
Annoy him so much with getting him on it and eventually it works?
What a marketing strategy...
 
Well look at wordpress now
 
I'm good, thanks anyway
 
why, what happened?
 
11:35 AM
to wordpress? mostly the passage time coupled with an obsessively backwards-compatibility driven development ethos
 
No, to you, silly.
:B
 
Say what you like about the tenets of Wordpress development, dude, at least it's an ethos.
 
I prefer "move at a glacial pace and break things"
@mega6382 ?
 
@DaveRandom ???
> I'm good, thanks anyway
It was just a response to this.
 
well that was just a response to you invitation for me to look at wordpress
 
11:40 AM
xD
I thought it was a rant
Btw, I am abandoning the use of !!dad in the favor of @DaveRandom->getJoke(rand(0,10000)); which is more efficient and has a bigger storage of jokes.
2
Just see for yourself:
@DaveRandom ->getJoke(rand(0,10000));
hmmm, that's disappointing...
 
After a bit of pain in the arse, I still managed to help someone woohoo.
Can I get a cookie now?
 
Wes
setcookie("cookie", "cookie", 0, "", "mike.m");
 
Thanks, which flavour is it?
 
Wes
potato
 
setcookie("cookie", "chocolate chip", 0, "", "mike.m");
 
11:50 AM
@mega6382 <3
 
Wes
potato.
 
A potato cookie, sounds disgusting
 
@Wes If its deep fried, I'll take it
 
Wes
raw.
 
Then, no, thanks
 
11:53 AM
Are there any known issues regarding the subclassing of SimpleXmlElement?
 
Wes
@Ocramius do you have a code style guide on parentheses i can follow, e.g.
$a = $x || $y; // acceptable
$a = ($x || $z); // too pedantic
$a = $x || $y && $z; // terrible idea
 
@Wes wrap any alternating conditions in parens except top-level
 
Wes
so even $a = ($x || $z) ?
 
except top-level
 
Wes
top level is assignment
 
11:59 AM
I meant top-level of the condition
 

« first day (2743 days earlier)      last day (2219 days later) »