« first day (1508 days earlier)      last day (3422 days later) » 

12:09 AM
TIL editing answers while you're drinking is not a good practice.
 
12:21 AM
@NikiC If you prefer poorly dubbed cartoons, you could also watch Ulysses 31 for the story. It at least has a kickass theme song.
 
guys, is anyone proficient with haproxy online?
if anyone curious - this is the question serverfault.com/q/648383/45086
 
@DanLugg Sometimes me automating a task has saved me time, e.g. github.com/TazeTSchnitzel/PhotobucketScraper
 
12:55 AM
@ircmaxell For us, time is not the most expensive cost ^^
 
ehhh ... ya know what sucks
when, after writing JS for a week, you realize that you might have to start from scratch, because the original code is unmaintainable and you thought of a better way to implement it
... well ... on other hand, I have got past the "looks like my 9 month old JS code is more advance then anything I can write right now" issue
I hope it's a common problem
 
1:44 AM
^^
 
2:18 AM
@philsturgeon @thephpleague Has anyone brought up the fact that you're one letter off from thephplague? ;-)
 
o.O New Dan Lugg gravatar is finally coming through.
 
It's just stack, I forget my wordpress password. Fucking gravatar.
@LeviMorrison So, I've ultimately given up on the magic.
 
^^ I figured you would eventually see the error of your ways, or wear thin on your diligence.
 
I wouldn't jump the gun on "error", I still think there's potential, it just outweighs my diligence ;-)
I've instead favored, Collection, which just encapsulates a generator (and some other necessities), through which CollectionEnumerator can map, and CollectionAggregator can reduce.
map and reduce, of course, being blankets for all mapping/reduction operations.
s/diligence/diligence and sobriety/ I've been on a bit of a bender.
 
2:39 AM
^^
I've been working on seeing if C versions would be much faster given the fact that many of them have to call user-land functions and whatnot.
 
I would assume as such, at least as a reduction of overhead. Surely you could accomplish a more performant version in core/ext.
 
They are at least more memory efficient.
 
Are closures "bad"?
 
Define "bad"?
 
^^ Memory footprint relative
 
2:42 AM
Oh, they're okay unless I am mistaken.
(misremembering, I mean)
 
I dunno the implementation details, hence question.
 
I believe there's actually an optimization I can do to get rid of a pointer in them, though; going to go check ^^
 
Y I DON'T KNOW MOAR PHP C?
 
C is a really easy language, honestly. The problem is that PHP source is macro heavy and full of abbreviations :/
 
^^ I "know" how to write C, but yea, what you said
Do I understand correctly, there's work being done to remove TSRLMBBQWTF?
 
2:45 AM
I like name of '::' in php, but I do not remember it : )
 
@sectus Double colon. Because that's what it always shoulda been.
 
Paamayim Nekudotayim
 
@DanLugg Yes.
 
Scope Resolution Operator > Double Colon > ... > Paamayim Nekudotayim
 
Latest tests show no slowdown supposedly.
If so that's a huge win ^^
 
2:47 AM
@LeviMorrison Thread Safe ...?
Resource Manager?
 
Yes. It uses native TLS and it happens "magically"
TSRMLS_DC <- Thread Safe Resource Manager... Local Storage? Definition... C?
 
Well, at least that's something userland can expect when transitioning to core development... gratuitous magic.
Living at my parent's is bad for my health. I can smoke at a computer.
 
Health tip: don't smoke.
 
Health tip: shut up.
;-)
 
Save your heart.
 
2:51 AM
Eat a spleen. ^^
Srsly though, I purchased an e-cigarette thinking the experience would be comparable. Not at all.
I (despite popular opinion) enjoy smoking conciously.
 
Upon further inspection I think I can get rid of a pointer in zend_closure.
 
I wish I could just smoke cigars.
@LeviMorrison lxr?
 
Oh wait actually.
PHPNG changed it from a pointer to embedded.
That actually expands the memory size.
Perhaps it was a measured improvement for performance.
I'll have to look through the logs for that one. But basically you embed the this_ptr in the function->common.scope variable and use a flag to know which it is using (scope or this, because you never use both)
@DanLugg What's a function from our Collections work you suspect may see speedup by being implemented in C?
@DanLugg ? Where you go, mate? Just when I actually need to talk to you I can't find you >.<
 
lol, sorry, hadta switch machines. lxr whacked chrome on the other one.
tbh, I don't know, that'd come down to understanding resource management under the hood, and I don't understand that particularly well
I would actually, gladly, accept a performance hit given support for decomposable expressions.
so you could walk closure/lambda AST trees for various transformational purposes.
mind you, I understand that's off in left field from an implementation standpoint, but not as far as use-case considerations for Collections
 
3:08 AM
Hmm.
I think I could speed up all iterator operations if the classes are final
Think that's worth doing?
 
Does final really yield observable performance gains? I've heard that mentioned before.
It limits the hierarchical checks needed?
 
Yeah, I think so.
But… once a class is created there isn't any need to worry about it.
Unless you enable runkit you can't just make it suddenly extend new things.
 
Ugh, I wish runkit were in core (sometimes)
"open classes" a 'la Ruby are pretty sweet.
 
Hmm.
I think I'll implement SortedSet first.
There are obvious memory gains there.
From the memory improvements alone I'd expect a lot of speedup.
I'm attempting to write my own class in PHP-src, and it's a bit unclear how I'm supposed to do garbage collection and object handlers and all that jazz; you guys know of a good resource? @ircmaxell @NikiC @AndreaFaulds @bwoebi
 
3:54 AM
@LeviMorrison I typically use ext/dom code to figure that out
 
4:42 AM
Thanks, @Ja͢ck. It's somewhere to look ^^
@Ja͢ck Hey so...
How much do you know about this object stuff?
 
Enough to get by :)
 
I'm not trying to integrate with code I can't touch; I'm writing this stuff explicitly for PHP core.
So, basically I'm trying to figure out how to write a class that can be refcounted, interact with PHP etc but have as much control as possible over memory layout.
 
Well, you have full control over your intern
 
I know strings and arrays do this, but they don't have properties or methods, etc.
@Ja͢ck So I basically start my struct with zend_object?
Realistically I don't need the HashTables and stuff; presumably since I implement my own handlers I don't need to have them in memory? I mean since nothing would touch them anyway?
 
Oh, you want to do without those? Err, not sure whether that's a good idea.
 
4:57 AM
They aren't used at all; I'd prefer to not have them around.
 
Hmm yeah, so I know enough about objects to basically not mess around with those structs :P
 
^^ so if I'm not doing that I just have a zend_object at the front of it?
@Ja͢ck Do you know much about fci and fci_cache?
 
The typical intern struct has a zend_object as its first member
Though, I think DOM places it at the end .. not sure why
 
Probably because that stuff is used infrequently when compared to the actual dom object stuff.
 
@LeviMorrison I've played with those a while ago when implementing a call method with n args
 
5:04 AM
Basically, I'm going to create a SortedSet that takes a callable in its constructor. That callable is going to be used a lot so I'm trying to figure out how I can make it fast.
 
fci_cache would be the way I guess.
Oh, found it ... spl_instantiate_arg_n()
That's what I was working on.
 
I'm not sure I know what fci and fci_cache are, really.
 
Until then you could only instantiate objects with one or two args
 
Are they both reusable?
 
I think so
 
5:10 AM
So if I call the same function multiple times it's safe to use the same fci and fci_cache each time?
 
Isn't that what you meant by reusable? :)
I'm pretty sure the cache is reusable, not sure about the info ... perhaps @NikiC can shine some light on that.
 
I'm just trying to be thorough ^^
 
5:26 AM
typedef struct {
        zend_object     php_object;
        zval *          data;
        int32_t         size;
        int32_t         capacity;
} collections_vector;
void collections_vector___construct(collections_vector *v, zval f, int32_t capacity);
void collections_vector___destruct(collections_vector *v);

void collections_vector_push(collections_vector *v, zval *value);
void collections_vector_pop(collections_vector *v, zval *value);

zval collections_vector_index_get(collections_vector *v, int32_t index);
void collections_vector_index_set(collections_vector *v, int32_t index, zval *value);
zend_bool collections_vector_index_exists(const collections_vector *v, int32_t index);
Well, easy part is done ^^
 
:)
 
@Ja͢ck Any idea how you are supposed to namespace something from internals?
Do you just give it a name that includes the full namespace?
Collections\\Vector?
 
INIT_NS_CLASS_ENTRY
 
lmao basically those things are the same.
lmao they are exactly the same thing.
 
@Ja͢ck I did not touch the last few lines. The problem was with not checking for errors. The safety of the output is for another time. — Sverri M. Olsen 1 min ago
@LeviMorrison Yeah :D
Just more abstraction
 
5:43 AM
@Ja͢ck Isn't there a zpp none function?
I can't seem to find it.
(Or macro)
 
zend_parse_parameters_none()
 
@Ja͢ck So… if I was doing a multi-level namespace...
INIT_NS_CLASS_ENTRY(ce, ZEND_NS_NAME("PHP", "Collections"), "Vector", vector_methods);
Should I do that or:
INIT_NS_CLASS_ENTRY(ce, "PHP\\Collections", "Vector", vector_methods);
 
The first looks a bit quirky but probably it's the more proper :)
 
^^ Okay.
 
6:10 AM
moin
 
Hey, @JoeWatkins.
What's the proper way to do the reverse of a ZVAL_COPY? Z_DELREF_P is the only lead I can find and that doesn't seem to be what I need.
 
reverse, as in delref first before copy, why would you need to do that ?
 
Do you mean zval_ptr_dtor()?
 
Nonono, what I mean is I copy a zval to my container using ZVAL_COPY. When I'm done with it I should clean up; what's the correct function?
 
what jack said
 
6:25 AM
\o/ Segfault
 
Yay!
 
I should probably allocate memory in __construct
…except what I'm looking at doesn't :/
 
Hi guys...
 
create_object handler should alloc the object
show me code / pastebin / gist ...
 
Ah, that function is null ^^
 
6:32 AM
you need that set
 
I'm having one question...
 
return &intern->php_object (if we are talking about 7)
 
in file upload
can I ask?
 
@CJRamki , I have asked already.
please, specify your question.
 
@LeviMorrison winning ?
 
6:35 AM
I think so.
Still writing the handler.
 
I'm doing file upload.
In that I checked file already exists or not using file_exists()
If the file contains same name that already exists in that directory, I want to ask user to rename or overwrite.
Is there any way to ask that during runtime?
and I need to do action depends on user input.
 
@CJRamki , no. You could temporary save file and ask user to point new name of it.
 
so, I can't hold that temporary file after page reload. right?
so I should store that file in some other location, and ask the user then I relocate that file to my desired location with user requested action.
right?
 
@JoeWatkins \o/ It's an incomplete handler but it has enough to not segfault ^^
 
lemme see ?
a handler doesn't really need to do anything other than alloc, do zend_object_std_init stuff and set handlers
 
6:42 AM
zend_object* collections_vector_create_handler(zend_class_entry *class_type TSRMLS_DC)
{
        zval *tmp;
        collections_vector *v;
        v = emalloc(sizeof(collections_vector));
        memset(v, 0, sizeof(collections_vector));
        v->php_object.ce = class_type;

        return  v;
}
 
@CJRamki , you have to use move_uploaded_file anyway otherwise file could be lost.
 
arghhh
 
@sectus ok...
thanks for your help...
 
typedef struct {
        zend_object     php_object;
        zval *          data;
        int32_t         size;
        int32_t         capacity;
} collections_vector;
^ There's the collections_vector definition.
 
zend_object* collections_vector_create_handler(zend_class_entry *class_type TSRMLS_DC)
{
    collections_vector *v;

    v = emalloc(sizeof(collections_vector));

    zend_object_std_init(&v->std, ce TSRMLS_CC);

    /* if using properties */
    //object_properties_init((zend_object*) v, ce);

    v->std.handlers =
        zend_get_std_object_handlers();

    /* if using custom handlers set ^ to addressof those handlers */

    return  &v->php_object;
}
that
 
6:48 AM
What's ce? You mean class_type?
 
zend_object_std_init(&v->php_object, ce TSRMLS_CC);
 
you could also cast v to zend_object* and return that
yeah that ...
@Ja͢ck and that
we usually name zend_object std
 
yeah
 
Bleh, the handlers changed from PHP 5 to 7.
Boo hoo.
 
it did yeah, we used to have to call obect_store_put and set more handlers .. now those handlers are in the handler table
and we used to have object values
but zval_value contains zend_object* now
 
6:52 AM
=( nobody seems to appreciate xpath ...
 
nicer this way ... by lots ...
@Ja͢ck xpath from jquery you mean ?
:p
 
hmm?
what do you mean by 'from jQuery' ?
 
@JoeWatkins You have a bitbucket account?
 
@LeviMorrison I don't
@Ja͢ck I kid I kid ... jquery is what hipsters call javascript, right ?
oh yes I do
is krakjoe
 
I added you to a private repo.
If you could give it a quick look I'd appreciate it (and let me know if it is missing files)
 
6:56 AM
will do
 
I don't want this project public just yet, which is why it is on a private repository on bitbucket.
 
We use bitbucket at work :)
 
morning
 
@LeviMorrison I have an easy to guess handle on bitbucket eh? heh
 
If you know a certain other handle ^^
 
7:01 AM
:D
 
da wabbit
 
@LeviMorrison Looks okay at first glance.
 
why is vector data zval *
not zval** ?
 
Tabs ... interesting.
@LeviMorrison ZPP "l" takes a zend_long.
 
@JoeWatkins It does not work with references by design, so there is no issue with zval * yeah?
@Ja͢ck Ah yes, I forgot. Shall have to fix that.
 
7:05 AM
yeah but all the zval_copy stuff is wrong then
 
^^ I have no idea what I'm doing
PHP source is arcane.
Basically, if the zval points to something that is a reference type it should get a refcount increment.
That's the intent of the ZVAL_COPY.
 
/me is waving wand
 
/me waves back
 
Stop waving wands at each other ;-)
hmm, why is your collections_vector_create_handler inside vector.c? I had expected it in the other implementation file.
 
Just looking for some general advice here, I'm looking for sites with good coding tutorials and someone has recommended Plural Sight, has anyone used this?
 
7:13 AM
Then again, it doesn't really have an API that separates C from the PHP bindings.
 
You mean php_collections.c?
How do a phpize against php-src? (meaning not my globally installed php)
 
moved
 
@Ja͢ck The intent in this case was to keep php_collections.c as uncluttered as possible.
 
okay ...
 
I mean, I'll have a gajillion methods in there eventually, right?
 
7:18 AM
Possibly.
 
I suppose it's possible to create php_vector.c and have php_collections.c pull it in. I just don't see any other extensions doing that at all. They just put all the glue into that one file.
 
You could create a C API and write against php_vector.h; that way, the bindings are all in one file and the API may be split across different implementation files.
 
Morning
 
Mornngdgn
 
the create object handler isn't used directly anywhere but minit, so convention and common sense dictates it should be static inline in the file that contains minit
pushed some changes ... there is a good starting place ...
 
7:30 AM
 
v->capacity *= 2;
doesn't seem like a good idea
 
because when it really matters (huge vectors), doubling capacity would be way overboard
 
Perhaps.
I have to start somewhere, and easy of implementation + easy to identify properties make it a good choice to start with.
 
Also, that's what hash tables do ;-)
 
7:33 AM
yeah sure, just an observation ... you spend more time thinking about this than I do ...
 
Besides, I give users the capability of setting initial capacities; they can set it to sufficient capacity if they need ^^
Also, why do you cast to collections_vector * in php_collections_fetch?
 
but the cost of the calls to getCapacity and resize are going to be considerable when all you want is realloc
because Z_OBJ_P is a zend_object*
 
Ah, I see.
I figured it was a void *
 
no we actually did something properly for once :D
 
:D
Oh, you finished the bindings for me too.
 
7:35 AM
I did, just to make sure on right path
no I didn't do get / set, you need array access handlers still ...
 
Yeah, saving that for later.
 
also don't forget arginfo so that reflection works properly...
__destruct should be moved to handler
 
@JoeWatkins I don't know how to do that.
 
I'll do it ...
 
@JoeWatkins Some implementations use a factor of 1.5 instead of 2.
 
7:48 AM
an adjustable strategy seems like the php-thing-to-do, you could set the ratio maybe ...
easily wrong ...
I pushed moar changes
I'll stop now ... unless you ask me something ... carry on ;)
 
@LeviMorrison Why not golden ratio? ^_^
 
@Ja͢ck Takes too long to reclaim memory.
^^
 
should take the perfect amount of time ...
 
yup yup
 
7:53 AM
^^ In practice too long.
 
setResizeStrategy(VECTOR::GOLDEN)
 
^^
So I need to s/int32_t/zend_long/ yes?
 
not for 7
 
zend_long is always 32 bit?
Seems wrong. I think zend_long is the size of the hardware's native long (not the OS's) yes?
 
ah
yes
yeah do search/replace
I totally lost track of those changes ... was under the impression int32_t was used for lengths and sizes everywhere ...
 
7:58 AM
For sizes that may be true, honestly.
 
but wait ... do you want 64bit lengths on 64bit and 32bit lengths on 32 bit, or 32bit lengths on both is the question ...
it might create some inconsistency to try and support 64 bit
 
Perhaps.
How do I do phpize in a source build?
Or build an ext in it?
 
plus you're never going to have that many elements in a vector to require 64 bits
phpize in the ext dir
then ./configure && make install
 
But phpize in my global path is not the same as the one I need to use.
 
Then find the phpize you need.
 
8:02 AM
then reference by full path and when configure use --with-php-config=/full/path/to/php-config
 
@Ja͢ck The one in scripts/ is not runnable.
 
huh?
 
Ehh
Then just sh <path/to/phpize>?
 
I'd really make install, you need php-config too ...
 
I definitely am not going to overwrite the system's versions ^^
 
8:03 AM
oh no no
should ./configure --prefix=/opt/or/whatever on the php7 build ...
and --with-config-file-path and --with-config-file-scan-dir set properly too
 
Why isn't phpize built and all that jazz? Why do you have to install it somewhere for them to be available?
 
because install command is the thing that sets perms is all I think ... but you don't want to be reading a php5 config file, or scan dirs
you really want to separate the installation and installations are finalized on make install
(it copies shared libs and stuff too)
 
Actually, for my extensions I just clone them inside ext/ directly and compile them into php.
 
@Ja͢ck Anything special to do in order to do it that way?
 
I have a bagillion extensions ...
just make sure you clone before buildconf
./buildconf --force
 
8:07 AM
^^ That
 
if it doesn't pick it up, then rm -rf aclocal.m4 && rm -rf autom4te.cache && ./buildconf --force
also, you intend to rfc this for merging ?
 
@JoeWatkins Not anytime soon, no.
API is still not stable.
Much easier to sort that outside of core.
 
just thought using \PHP namespace might annoy some folks ...
 
Oh, I intend to put it there. And this is also one reason it's not a public repo.
 
so long as it's being rfc'd at some point then there's no problem I don't think ...
you have the rest of the api designed already or no ?
 
8:14 AM
I have it designed but I'm still not satisfied.
What I'm doing right now is testing internals so I know what other design decisions should be made in userland.
Definitely not supporting references, for one.
Alright, time to sleep.
 
good meurning!
 
moin
 
morning
 
8:27 AM
echo hex2bin('676f6f64206d6f616e696e67');
3
 
echo hex2bin('676f6f64206d6f616e696e670a');
please
 
8:41 AM
hi everybody
 
:)
 
I'm facing a problem with php. In particular, I have a CentOS 6.5 server with 5.3.3 version and I need to install on it a website with Joomla 3.3.6. It needs the 5.3.10 version of php, but the CentOS official repo does not allow to install it...I've read about external repositories...anybody knows how to install another version of php, avoid deleting the existing one?
 
Compile your own :D
 
hi guys
 
Morning
 
8:49 AM
Am having a problem in cometchat integration with a php site.In chat rooms I can send and view my message but cannot see other users messages
 
don't install 5.3 for anything you care about ...
 
/me stuck on 5.3 for some reason
 
burn whoever is responsible ...
 
I'm guessing they don't want to touch anything so all of it doesn't fall apart :-)
At least it could be 5.4, even 5.5, without problems... (code is not bad/too old)
 
Fire making, fire lighting or fire craft is the process of starting a fire artificially. Fire was an essential tool in early human cultural development. The control of fire by early humans is said to date back to either Homo erectus or very early Homo sapiens: that is, 400-200 thousand years ago, based on archaeological evidence of hearths. Smouldering plants and trees, or any source of hot coals from natural fires, may have been the first resources exploited by humans to control fire. Friction is the most commonly used primitive method for making fire. Ancient techniques for starting friction...
should be something helpful in there ...
 
8:54 AM
@Jack is your p.pic from bleach?
 
@JoeWatkins Matches sound modern.
 
@webarto my condolences
 
AWS something, something...
 
hehe
 
good moomins
 
8:59 AM
morning @salathe
 
@tereško :'(
 

« first day (1508 days earlier)      last day (3422 days later) »