« first day (1414 days earlier)      last day (3534 days later) » 

Guys please give me a quick help I can't find tutorial for Fast Route
 
@NikiC ^
 
What should be here and in which format
$routeInfo = $dispatcher->dispatch($httpMethod, $uri);
 
@VeeeneX Read the readme....
 
@Danack My english level is ehmm ....
$uri = explode("/", $_SERVER["REQUEST_URI"]);
$request_method = $_SERVER["REQUEST_METHOD"];
@Danack ^
or @SecondRikudo :D
 
@Fabien lolwut
 
@VeeeneX /* Routing against GET /user/nikic/42 */
 
Cannot vote twice :(
 
9:18 PM
Ha @NullPoiиteя, yes it is a bit bright :-p
It's a standard WordPress theme though, so I claim the need for sunglasses is not my fault.
 
@Danack :D
 
@VeeeneX: if you have a question featuring code, which you've made an attempt on already, could that question go on Stack Overflow proper? (I'm sure it's on topic here, but you may find being able to write a full question easier there than here).
 
But PHPFastRoute doesn't have any base path?
@halfef yes, I know but there are several reasons why i posting questions here
 
@LeviMorrison you haven't been active in web-php for a while? "My work here is done."? :)
 
@VeeeneX put your code in a pastebin/pastie
 
9:25 PM
@VeeeneX What are those?
 
@webarto Quite the opposite: leviathon.homenet.org
It just... sucks :D
I'm tearing it apart to rebuild with polymer.
 
Much fade :D Pardon me, Sir.
 
And at the moment I am trying to get return types working on master branch.
Priorities; website can wait.
 
@VeeeneX: you mean @halfer - use tab to autocomplete :-)
 
Especially since using Polymer restricts the number of browsers that can run our site. May as well wait a bit longer and therein upset a few less people.
 
9:33 PM
@LeviMorrison Website is pretty good, you did the hard part, others can fiddle with it.
@Levi are you talking about polymer-project.org ? I'm totally out of anything.
 
@webarto Yes, that is the one.
 
At work "we" use PHP and Marionette, Backbone, Underscore, Handlebars... basically PHP doesn't output any HTML, only JSON. Is that similar? I can't figure out what it is.
 
@halfer Sorry, I'm on mobile
 
@webarto it is abit similar to angularjs directive
just native
 
9:50 PM
Always passing zval ** to zend_hash_find instead of zval *** … I hate too much indirection :-/
 
:/
I keep getting segfaults when adding to the zend_op_array, zend_function and zend_internal_function structs.
 
NP
 
@LeviMorrison what are you doing? (code)
 
@LeviMorrison you did make clean first?
 
9:56 PM
I did make distclean and ran php Zend/zend_vm_gen.php.
Reconfigured, everything.
(that I can think of)
 
then weird.
 
I haven't attempted to use it at all.
I've just added it to the structs.
 
what segfaults do you then get?
 
Let me give you a backtrace from one of the autoload tests
(gdb) run tests/classes/autoload_012.php
Starting program: /home/levijm/Projects/php-src/sapi/cli/php tests/classes/autoload_012.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
In autoload: string(6) "UndefC"

Warning: call_user_func() expects parameter 1 to be a valid callback, class 'UndefC' not found in /home/levijm/Projects/php-src/tests/classes/autoload_012.php on line 7

Program received signal SIGSEGV, Segmentation fault.
 
what line is that in frame 1?
 
10:05 PM
fbc->internal_function.handler(call->num_args, ret TSRMLS_CC);
(gdb) p *fbc->internal_function.handler
$3 = {void (uint32_t, zval *)} 0x58306b <zif_var_dump>
 
please dump *fbc here
 
(gdb) p *fbc
$6 = {type = 1 '\001', common = {type = 1 '\001', fn_flags = 16777472, function_name = 0xad3350, scope = 0x0, prototype = 0x0, num_args = 1, required_num_args = 1, arg_info = 0x797920,
    return_type = 0x7fffffffda40}, op_array = {type = 1 '\001', fn_flags = 16777472, function_name = 0xad3350, scope = 0x0, prototype = 0x0, num_args = 1, required_num_args = 1, arg_info = 0x797920,
    return_type = 0x7fffffffda40, refcount = 0x58306b, this_var = 11321776, last = 0, opcodes = 0x31, last_var = 1, T = 1798, vars = 0xb1a9c09d428af89d, last_brk_cont = 15, last_try_catch = 0,
Note that the return_type pointer is incorrect.
I do set the pointer to NULL when I initialize the zend_op_array.
I think you have access to this machine.
If you want to log in and such.
 
no, I don't.
only Daniel has.
 
No, you have access.
Want me to reset your password?
I just sent you an email with a password.
 
ah, found the mail
…^^
Just tell me the path of your install?
 
10:16 PM
I just checked it out at /tmp/php-src for you.
It's running configure right now
(and make)
 
okay, ping me when it's finished
 
It's running tests now so I can give you a list of failed tests (although there are a few normal failures on master)
if you want to run the one I was doing up above, it is tests/classes/autoload_012.php
@bwoebi done.
 
how come the date ext has a config0.m4 and not a config.m4? It prevents phpize from generating the configure file
 
(gdb) p *fbc
$1 = {type = 1 '\001', common = {type = 1 '\001', fn_flags = 0, function_name = 0x0, scope = 0x0, prototype = 0x0, num_args = 0, required_num_args = 0, arg_info = 0x0, return_type = 0x6815e0}, op_array = {type = 1 '\001', fn_flags = 0, function_name = 0x0, scope = 0x0, prototype = 0x0, num_args = 0, required_num_args = 0, arg_info = 0x0, return_type = 0x6815e0, refcount = 0x0, this_var = 0, last = 0, opcodes = 0x7068702f706d742f, last_var = 1668444973, T = 1852135983, vars = 0x655f646e657a2f64,
@LeviMorrison that's what I get…
(at the point of the crash)
with the handler really being NULL.
 
10:31 PM
I haven't touched anything that I can think of there.
You can review the last commit to double check but
I don't think I've touched it...
 
well, no idea…
I cannot reproduce your results…
 
I printed the wrong one above.
My point is...
this should not segfault
All I did was add teh struct member and it started dying
git show on it and you'll see. Everything is innocuous as far as i can tell :(
 
I see... mh.
 
memset(op_array->reserved, 0, ZEND_MAX_RESERVED_RESOURCES * sizeof(void*));
That instruction changed the data.
I set a watchpoint on the memory location to see when it changed.
Old value = (zend_return_type *) 0xfffffffff68760c0
New value = (zend_return_type *) 0x0
init_op_array (op_array=0x7ffff6877000, type=2 '\002', initial_ops_size=64) at /home/levijm/Projects/php-src/Zend/zend_opcode.c:99
99		memset(op_array->reserved, 0, ZEND_MAX_RESERVED_RESOURCES * sizeof(void*));
It's the line after my initialization... Hmm...
 
10:49 PM
huh? op_array->reserved is the last member of the struct … how does that affect your return type?!
btw. any reason why you use a pointer to zend_return_type instead of a direct value in the struct?
op_arrays shouldn't be duplicated anyway…
 
That's just what Joe did.
 
ok.
 
He had more info in his version as well; maybe he didn't want to bloat the op_array size?
 
^ no that's definitely not an issue. not if you need to alloc memory anyway…
 
Oh; you'd need a way to distinguish between one existing or not if you embedded it directly.
But that's about the only thing I can think of.
Is there an "unused" value for zend_uchar?
 
10:56 PM
no idea
 
@LeviMorrison not in general, but in this case IS_UNDEF seems suitable
 
@JoeWatkins pong, sorry, was out all day
 
Okay.
I'll try embedding it and see what happens.
 
11:16 PM
Well... I still get the segfault
 
:-(
 
And the class_name pointer isn't set to null like I said itshould be
I suspect somewhere op_arrays are getting manipulated incorrectly such that adding anything will cause issues.
That or there is some other struct I need to add it to.
 
I agree, but I couldn't find such things before… maybe I've overseen something…
 
Interesting.
I changed the type of the return_type entries in the structs to be a uint32_t.
Now it won't compile.
/home/levijm/Projects/php-src/Zend/zend_execute.c:80:2: error: initializer element is not computable at load time
/home/levijm/Projects/php-src/Zend/zend_execute.c:80:2: error: (near initialization for ‘zend_pass_function.return_type’)
  71 static const zend_internal_function zend_pass_function = {
  72     ZEND_INTERNAL_FUNCTION, /* type              */
  73     0,                      /* fn_flags          */
  74     NULL,                   /* name              */
  75     NULL,                   /* scope             */
  76     NULL,                   /* prototype         */
  77     0,                      /* num_args          */
  78     0,                      /* required_num_args */
  79     NULL,                   /* arg_info          */
This function is missing the return_type entry.
err
This initializer
How many places have things like this?
 
one. only this one.
 
11:31 PM
Well, that appears to fix my issue.
The first member of the struct was a pointer, so it didn't error because they were compatible (or something)
 
:o
 
@FlorianMargaine Yeah, I wouldn't have thought of that I think :) github.com/php/php-src/commit/…
@bwoebi It's a fool that looks for logic in the chambers of the human heart ... :)
 
Now I can finally try hooking it up to the AST.
 
@Ja͢ck … that's not the answer I wished^^
 
@bwoebi well .. why was it a valid option for a boolean false then?
 
11:36 PM
@Ja͢ck (bool) null === false?
 
The values for false are defined in the lexer as: off, false, no, none, null
yeah sure .. but why not just leave 'null' off altogether ...
it's used for flags, right? isn't off, false, no, none enough?
 
0 is also interpreted as false?
 
i think lexer says it's TC_NUMBER
 
Why was hex2bin removed from PHP5?
 
@webarto i don't think it was ..
 
11:38 PM
@Ja͢ck I mean, when it comes to resolution later.
But there's no gain in separating null in lexer
 
@Ja͢ck So it never existed at all? Boss says it was available in PHP4. I wasn't born then.
 
@webarto hex2bin still exists?
 
It was introduced in PHP 5.4
 
...supposedly it exists in PHP 5.4+?
It does not even do what you would think it does.
 
Haha, I don't even
 
11:41 PM
> Caution This function does NOT convert a hexadecimal number to a binary number.
 
@bwoebi it's a bareword 'null', so in line with expected typing, i don't see how turning false into null is expected ...
 
@Ja͢ck !?
 
If I put foo = null in an ini file and now I say that the scanner will observe typing, would you expect foo => false ?
 
@LeviMorrison Should be return pack( 'H*', $hex );, but who knows.
 
florian@fedora date$ make

Build complete.
Don't forget to run 'make test'.

florian@fedora date$
sounds like something is wrong... I can't compile ext/date anymore :(
 
11:44 PM
Derick cursed it.
 
@FlorianMargaine ehh?
are you running make from ext/date/?
> $ make
make: *** No targets specified and no makefile found. Stop.
hmm okay, i guess you're not ... what are you doing? lol
 
I am
run phpize before
 
^ I assume he has ran phpize on it.
 
right ... hmm, i've never tried that before heh
 
you just run make from the root folder every time you work on an extension?
 
11:47 PM
yeah
 
though it should work in the same way, really.
it's just that you need to specify --with-php-config=DIR during ./configure when you want to compile separately.
 
@FlorianMargaine yeah, why not?
 
@bwoebi so, is there still a misunderstanding, or ... ? :)
I appreciate your feedback, of course, but it seems that my counter argument didn't hit the target =/
 
I think we just disagree whether it's necessary.
btw. @Levi that's the issue with large codebases like php-src…
 

« first day (1414 days earlier)      last day (3534 days later) »