« first day (1275 days earlier)      last day (3666 days later) » 

12:02 AM
Heh, this code fixer doesn't actually fix anything... useless.
 
Can I run oci8 (in other words, oracle) with xampp?
 
Night all
 
@DemCodeLines Yeah, why not?
@Fabien night
 
@TOOTSKI Do I have to install some extension or something or would it work right out of the box and I would manage it in phpmyadmin the same way i would manage a mysql db?
 
@Fabien night
 
12:12 AM
@DemCodeLines You can use any Oracle GUI.
 
Enable it in php.ini ... phpmyadmin is for mysql, you still need oracle server and gui.
 
what the heck
 
Well, you want to use Oracle, so you'll need to set it up for PHP
 
yeah, it's just annoying sometimes when somethings don't just work and you have to make like 10 other arrangements to get it to work.
 
Is it possible I found a bug already at this fixer @PeeHaa?
 
12:18 AM
Setting up Oracle is a one time task. I'd even get rid of XAMPP and custom build my own stack if I need to work with anything which is not Apache or MySQL.
 
its apache and php
so...
 
If you don't want to go through that trouble, just set up an oracle server and enable oci8 in php.ini
 
heh.. 4:27 AM. Something is wrong
 
12:40 AM
@TOOTSKI Possible but also possible is PEBKAC :)
 
@PeeHaa Ah, already fixed it seems, using 0.3 stable, 0.4 in the making.
Someone haven't heard of basedir it appears.
 
:P
 
what's the best hashing algorithm atm?
 
For passwords?
 
@PeeHaa OMFG it's not fixed.
> /opt/php-cs-fixer/crap.php/.php_cs
Screw 'em.
 
Do I absolutely have to have a try catch block when running a pdo query?
 
Not unless you're going to handle them.
 
:)
 
can you check meh PR, makes sense?
 
That stupid thing even got a freaking upvote
 
:(
 
1:24 AM
@TOOTSKI makes sense I think :)
 
Ok, I'll tell them you've told me :P
 
:P
Worst thing that can happen is that people start screaming at you ;)
 
@Ocramius and his buddies are hardly people.
 
:D
 
2:10 AM
Hi! Does anybody know how is about debug_backtrace() performance? If I want to use it instead of passing CLASS, FUNCTION, LINE to logging service, won't it cause any significant overhead of debug_backtrace() performance?
Does $limit argument matter in this question?
 
2:28 AM
I found opinions, that it is inefficient. I will believe.
 
2:47 AM
@tereško hi bestie
You haven't returned my calls, but copy is coming to visit and I'd like to send you a postcard.
So ping me on skype or whatever.
 
 
4 hours later…
6:29 AM
@bwoebi well done ...
 
6:48 AM
morning
 
7:23 AM
Isn't this a bit scary...
 
8:07 AM
"If debugging is the process of removing bugs, then programming must be the process of putting them in."
- Edsger Dijkstra
I just found out that the inability of echoing a boolean in PHP is not a bug but a "feature"
 
that's why we have var_dump() and print_r() ... I assume you are debugging something
 
2 messages moved from Lounge<Cloak>
 
1 message moved from Lounge<Cloak>
 
1 message moved from Lounge<Cloak>
 
8:23 AM
 
if you don't want them, just bin them, we certainly don't want them back.
 
if you didn't want them in the first place you could have binned them yourself, would you have answered that homework question for someone ??
 
@JoeWatkins You are assuming that we actually read the question, rather than simply recognising the code as inappropriate for the Lounge. It's PHP, so it seemed reasonable to move it to the PHP room. You are in a better position to determine the PHP binnability factor than us:)
 
How do I calculate the angle between the hour and minutes hands?

function getAngleOfClock($hourHand,$minuteHand)
{
//First method
//$covertMinuteIntoDigit=$minuteHand/5;
//$getMinuteAngle=12/$covertMinuteIntoDigit;
//return 30*($hourHand - $covertMinuteIntoDigit)+(1/$getMinuteAngle)*30;

//Second Method
return abs(($hourHand * 30 + $minuteHand * 0.5) - ($minuteHand * 6));

}
echo getAngleOfClock(2,10);

can anyone suggest me please, which one is correct to use means First method or Second Method or none
 
8:29 AM
that's reasonable, seemed like someone had started just dumping any old messages in here ... @MartinJames
 
Please give your suggestion??
 
@Pank that's your homework ...
 
If you guys/gals get a C++ question, please feel free to pass it to the Lounge, where DeadMG will be happy to bin it or, (very unlikely:), answer it.
 
@Jeo i am just trying to get angle
for few hr min I am getting correct angle
 
jeo is kind of a cool name ... neo-ish ... might use it ...
@Pank there's no way that's for anything but homework, there is no sense in us doing your homework ... I don't think anybody will answer the question here just like they wouldn't on SO ...
 
8:31 AM
@JoeWatkins I am sorry for name
 
@Pank Oh FFS now I understand why @Joe got annoyed. It's your code, why do you not debug it for those cases where the result is wrong, (and you didn't say for what cases). You want devs here to run your test suite for you?
 
@MartinJames ehehehe
 
@MartinJames : I wrote the scripts but both script giving same output so I conceived that take suggestion from expert and fix it.
 
that's not what we are here for, you don't get to post your homework questions on stackoverflow or their chatrooms, you can come in here and discuss specific complex problems, design patterns, ideas and kittens, you cannot ask us to do your homework, or equally your work, whatever, we're not here to do your shit ... whether it's homework, or someone is paying you to detect the angle between the hands on the clock makes no nevermind, do it yourself ...
 
@JoeWatkins Thank you very much, I got it
 
8:37 AM
 
Jonan you have a typo in your name :)
 
?
oh hahaha
sorry for my slow reaction, haven't slept much tonight :p
 
:)
the ~joke~ was pretty lame
 
Hi, I'm assuming everyone here did this one time or another. I'm working with php code and I want to redirect the old domain (including nested directories and query params) to a new domain.
namely blog.domain.com/folder1/folder2/baz?foo=bar to www.domain.com/blog/folder1/folder2/baz?foo=bar
What is the most elegant way to do this which isn't absurdly ugly?
 
@BenjaminGruenbaum You want to redirect or rewrite?
 
8:52 AM
you don't want to do that in php at all ...
that's a waste of a process ... huge waste ... the answer depends on webserver ...
 
oh...
 
@HamZa a 301 redirect
@JoeWatkins constraint
It's redirecting an old domain to a new one, I don't care about performance for now, it's legacy support.
I want to do it on php because (for reasons beyond me) the server is Apache sometimes, IIS sometimes etc.
 
and I was thinking of some htaccess-fu...
 
then there are a million ways to do it, beauty being in the eye of the beholder 'n all ... not much point in giving you code ... but you said not ugly, pretty ugly to invoke php to generate a single header and exit ...
 
I just don't want a really shitty one :D
 
8:57 AM
it depends what rewrites are being used on the way in and what they need to look like on the way out, just var_dump _SERVER and have a look around at what you have got ...
 
Yeah, that's what I'll do.
 
9:11 AM
Mo'nin
 
@JoeWatkins github.com/krakjoe/phpdbg/commit/… bad idea: now you introduce a memory leak: SG(request_info).argv[0] (only 0 index) is never going to be freed.
 
there was fault before ...
ah no heap corruption
from hash environment stuff
if there's better fix do it ...
 
just revert that one line
 
there will be heap corruption
 
really?
 
9:20 AM
yes
 
in which line?
 
you dont' get a line from heap corruption you just get zend_mm_heap corrupted or something like that ...
 
yes, set a breakpoint where msg is output and look at bt
 
you don't get a line ...
 
USE_ZEND_ALLOC=0 valgrind ftw
 
9:22 AM
because I cannot reproduce that here…
 
you don't get anything but that message but I can't make it happen now at all, when I switched of the mm it showed it was because of hash environment doing something with exec
I can't now either actually
scrolling up through all history ...
 
I mean with my old version
 
we aren't testing that version though are we ...
can't reproduce, I'll revert ... it was definitely there though ...
[joe@localhost php-src]$ sapi/phpdbg/phpdbg -esapi/phpdbg/test.php -n
[Welcome to phpdbg, the interactive PHP debugger, v0.3.2]
To get help using phpdbg type "help" and press enter
[Please report bugs to <http://github.com/krakjoe/phpdbg/issues>]
phpdbg> ev $argv
Array
(
    [0] => sapi/phpdbg/test.php
)

phpdbg> q
[joe@localhost php-src]$ sapi/phpdbg/phpdbg -esapi/phpdbg/test.php -n
[Welcome to phpdbg, the interactive PHP debugger, v0.3.2]
To get help using phpdbg type "help" and press enter
[Please report bugs to <http://github.com/krakjoe/phpdbg/issues>]
a different strangeness ...
how did that happen ??
that seeems very very close to a corruption to me ... very close ...
I can't remember what I was doing but it's lurking I can feel it ...
 
strange… I hadn't had that…
 
can you checkout master and see if you can spot it ?
 
9:30 AM
Btw. any reason why you put lexer/parser in a dev directory?
 
at first it was because I didn't want to bundle them with php and have to change either of them to conform with php's requirements, I dunno what they even are ... so thought we'd generate before distribution like php does and keep the lexer/parser in another branch or directory or something ... but I don't think that actually works
 
Morning
 
@JoeWatkins no, not really. Just put it all in root.
 
are you sure that's sensible, I still think it might be better to find out how to disable generation, I'd rather just bundle the source ... I'm not sure what parser/lexer requirements php has and if ours are compatible ?
@NikiC do you know the details of this, lexer/parser requirements for php ?? do you know how to disable make invoking flex/bison ?
@bwoebi that strangeness is only there when exec is not dup'd ...
master now, it wont' be there, if you revert that line you'll get strangeness or a fault ...
 
well… okay, but then it should leak memory I think?
as it's never freed then
 
9:42 AM
@JoeWatkins What do you mean by requirement? Bison dep is okay, re2c dep must be optional
 
is flex okay ?
 
as dep? no.
just grab the variables you already find in the php-src makefile and use them in your makefile
 
why is phpdbg_interact ifndef'd for windows ?
 
@JoeWatkins where?
 
9:48 AM
because label is unused in windows
github.com/krakjoe/phpdbg/blob/watchpoints_recursive/… is the only goto to it… which is also ifndef'd
 
okay cool
 
are you working on getting watchpoints into master now? :-)
 
yes, is merged locally, I am testing ...
can't build ... will patch it up ...
 
or did you just forget to buildconf make clean-phpdbg etc?
 
nah lexer stuff
 
9:54 AM
ah fine
 
done any help for watchpoints ?
 
@JoeWatkins Nope. re2c is okay as an optional dep (i.e. if you keep a pregenerated lexer commited)
We haven't been using flex since 5.2 or something
 
@NikiC any reason why bison is a dependency while re2c is optional? why not both optional?
 
@bwoebi Because bison is usually available, probably
Whereas re2c only because somewhat popular because php started using it ^^
Also the bison output is likely a lot more unwieldy
 
@NikiC it is? never noticed that… always had to install it myself first…
 
10:01 AM
@bwoebi yes, that's what I mean
available in package manager
that was very likely not the case for re2c when php started using it
so people would have to manually compile it, just to compile php
 
ah okay
 
@bwoebi you have a bit of time now ?
this feels pretty buggy, sure its because of the parser changes but you need to spend a bit of time on it ...
I've pushed the merge back to the watchpoints branch, have a look at it, and need to write help too
 
Yes, I can write help when we're finished...
 
well I am waiting to merge ... once you have fixed the bugs that are present now and there are help sections we can merge, because it will be finished ...
 
what bugs are there? (just compiling now…)
 
10:14 AM
I dunno, I couldn't get it to work at all, and the valgrinds were nonsense ..
it's probably because of the input parsing stuff there, but I dunno, I got it to register a watch on $array but it crashed when it reached it ...
it crashed a bunch of timese before I got it to do anything ...
watch anything
crash
ah
 
what ah?
 
pull
 
/var/root/php-src/sapi/phpdbg/phpdbg_bp.c:1004:28: error: too many arguments to function call, expected single argument 'op', have 2 arguments
                        if (zend_is_true(retval TSRMLS_CC)) {
                            ~~~~~~~~~~~~        ^~~~~~~~~
 
no my fault, Kalle's fault ...
is actually working okay now I think ...
still write help ...
 
no, I thought we've fixed that already…
 
10:18 AM
@bwoebi @JoeWatkins Really stupid change
 
yeah
then someone reverted or changed the stupid change ... piling on the stupid ...
 
Not just for the obvious reason, but because it actually hurts perf, not the other way around.
 
he didn't even test, he just went around changing everything he could see
 
@NikiC really? how? ... ah ok
 
Previously a TSRMLS_FETCH() was only required in an extreme edge-case, not you always need to do it if you don't have tsrm_id available and call zend_is_true...
 
10:20 AM
you only need to fetch for objects right ?
 
@JoeWatkins yes
and how often does sane code call zend_is_true on objects? Exactly, zero times.
 
yep, he just changed everything he could ...
 
that's not so edge-case… when functions might return an object or NULL/false like in mysqli->query()
 
but the vast majority of the time, you would be calling on scalars and they don't require globals is the point ...
tend to use instanceof if I expect an object ...
 
but still… is passing one parameter too much really hurting perf… yeah… one asm op and a L1 cache fetch probably…
 
10:22 AM
(Actually, I wouldn't say that it hurts perf, just that it could hurt perf and it's not at all obvious that it helps)
@bwoebi passing param no, but doing a tsrmls_fetch ^^
 
it's not one is it ...
there are no scripts that consist of if ($condition)
and that's it ...
it's not useful to look at the performance of this kind of code like that ... we can see that because of a silly change this function is hungrier than it need be and has an extremely high frequency and has broken my build many times ... it's annoying ...
even when we're writing an extension, it's still sensible to declare everything to accept tsrmls, but it's not sensible to just go plating it on the end of every signature in /Zend which is basically what he started doing ...
I'll bet there are more places it could provide advantage, if you tested and looked properly ...
@bwoebi are you writing help ?
 
@JoeWatkins bla bli blub tls patch blub bli bla
 
I know I know ... every weekend that comes round the list of things I have to do grows by 2, when it starts shrinking I'll look at it ...
 
@JoeWatkins meh
just do it :P
much more important that phpdbg stuff ^^
 
@JoeWatkins later, having some school things to do :-/
 
10:29 AM
@bwoebi we're just waiting for that when it has help we can merge ...
is working okay now ...
(was changes I had made)
@NikiC harder too, more time consuming too ... I will get to it ...
 
github.com/krakjoe/phpdbg/commit/… that broke my build… it's master only @JoeWatkins
 
also have to motivate pierre or weltling to do windows bits ,because fuck that ...
ah right I'll fix that ...
so it should be 50700 now ?
 
yes
 
fixed
 
I was using PHP-5.6 for some reason… so it noticed it^^
better
 
10:45 AM
I hate it when programs crash… as I tend to forget to save …
grml… Microsoft Excel… grml…
 
@bwoebi is working nicely, not necessarily now, but it would be nice if when you break on a watchpoint we only output the differences/changes rather than all of everything ... in the real world the output will not be usable ...
 
@JoeWatkins wait. I thought we only output changes?
 
Old value: Array ([0] => 0,[1] => 1,[2] => Array ([0] => 5,[1] => 4),[3] => Array ([0] => 7,[1] => 6),[4] => 6)
Old refcount: 2; Old is_ref: 1
New value: Array ([0] => 0,[1] => 1,[2] => Array ([0] => 5,[1] => 4),[3] => Array ([0] => 7,[1] => 6),[4] => 6)
New refcount: 1; New is_ref: 0
 
ah right… it's just when refcount/is_ref changes where we output also the value again…
 
I c
 
10:49 AM
Just one should be able to disable the internal info about refcounts etc.
 
zval_flat is not tidy, we need our own var_dump/print_zval equivalents...
 
@JoeWatkins why?
 
well var dump and the like are okay on the web/console, but this is supposed to be the usable interface to the debugger and there is more that we can do to make the output usable ... I think ...
 
Feel free to change output to what you want
 
our var_dump should work on zvals, not variables
I mean for anytime we output variables, maybe even override vardump, so ev $array shows same
 
10:53 AM
Feel free to change every output inside the black magic here: github.com/krakjoe/phpdbg/blob/watchpoints_recursive/…
actually I think watchpoints should output something flat, just as we else risk to end up filling pages when we encounter a big object…
also watchpoints are likely to be hit more than just once…
 
well then we should only output the part of the zval that changes when they are hit
I dont' really have an arrays that I would watch with 5 members ...
so that'll fill up screens too ...
yes ?
 
Try putting an if here: github.com/krakjoe/phpdbg/blob/watchpoints_recursive/… and github.com/krakjoe/phpdbg/blob/watchpoints_recursive/… if (memcmp(oldPtr, watch->addr.zv, sizeof(zvalue_value)))
so that it only is shown if the value also really changes
and look if it's better
@JoeWatkins hm?
and add also an below an if for if the refcount/is_ref has changed
but only if it wasn't removed I think
 
11:26 AM
will look ... few hings to do ...
 
MORNING
 
moin
 
moin
 
I see you guys are busy :D
 
hi guys..I'm having this really annoying problem that doesn't seem to be addressed anywhere
in JS:
var obj = <?php echo json_encode($php_variable); ?>;


gives me syntax error
 
11:33 AM
^ AHA! @NikiC
 
@Kensing what is in the php_variable?
 
and this:
var obj = [<?php echo json_encode($cfg) ?>];

gives me the specific syntax error error: var obj = [<br />
@RonniSkansing an array
 
Syntax error is in JS.
 
aye
 
You're missing quotes.
 
11:37 AM
the return value of the php json_encode includes a <br />
 
I don't know, you can't explain properly :)
 
show us the content of the variable, paste to pastebin or something
 
all right
 
If I use htmlspecialchars() correctly, does it prevent XSS for 100%?
 
@TOOTSKI hm?
 
11:43 AM
@NikiC Nevermind, I thought he decodes as object. Pardon.
 
@TOOTSKI He just thinks that JSON is valid JS, which is quite obviously totally wrong.
 
sorry for the wait:
http://pastebin.com/auVZQeyp

@NikiC, I've followed examples from SO that seem to be working for people, suggested by people with high rep
 
...
 
do I have to parse the JSON return result to my JS variable?
 
@NikiC :) I already answered, but, meh.
 
11:48 AM
@Kensing there likely is something more after that <br /> like ... an error message, maybe?
 
the <br /> is all I see in my console
 
Screw your console, view source.
That feeling when some PEAR script (last updated 6 years ago) works much better than fapbot one :)
 
I don't see the problem with my source that seems to be obvious to you guys
 
11:53 AM
Hardly.
I'm using PEAR/PHP_Beautifier to format code, tried to make fabpot/php-cs-fixer but that just fixes very specific things, it doesn't do much formatting (or any). Do you guys know of something else? First time I'm using this thing.
Who complained something 'bout hiphop yesterday? @Ocramius? travis-ci.org/fabpot/PHP-CS-Fixer/jobs/22866790
> OK (149 tests, 265 assertions)
and build is broken, right.
 
12:11 PM
@TOOTSKI are you trying to format or comply to a fig?
 
@RonniSkansing Good question, both. But, I can't comply to FIG if style is broken.
It doesn't do any formatting, it fixes e.g. if you combined spaces and tabs, but doesn't care about alignment.
 
yea
Lots of formaters out there, but I know of nothing that will convert to a specific fig style (other then the cs-fixer =/
 
Yeah, I couldn't find either, I'll use this beautifier and make some filters for it, so it formats properly, and then use fixer to fix anything else.
I'm looking for code that extracts .phar, lost it somewhere, heh... it would be ideal if all of this is one file.
 
12:34 PM
Wonderful :)
 
case "hey":
    $action = "hey";
    break;
looks better imo
 
indeed
 
Yeah, not that actually, tabs and spaces combination. I don't like switch, at all.
Has its usage of course, but most of things can be done more flexibly with arrays.
 
I use switch most of the times because if statements takes longer to write & looks bad
^ Unless if I have a very few statements to do
too bad you can't do something like case $a > $b:
 
Yeah, every has preference, when I write else I feel kind of bad :)
@user3123545 You can't?
 
12:38 PM
@user3123545 strings should be with ' instead of " =]
 
@TOOTSKI IIRC no O.o I remember it was a problem for me when I started PHP never tried it again.
 
and you can do a $a > $b
 
@RonniSkansing Well then I am still used to java's syntax. It was very hard to move from java to php lol.
 
@user3123545 Actually that makes sense, but where can you do that? Visual Basic? :)
 
switch( put true or false here )
 
12:40 PM
No ronni I mean in the cases like
switch ($number) {
    case $number > 6:
        break;
Is taht possible?
Doubt switch statements are designed for that.
 
$a = 1;
$b = 0;

switch(1)
{
  case $a > $b: echo $a; break;
  case $a < $b; echo $b; break;
}
Works, can use expression all in all.
 
Oh lol, didn't know that
Thanks ;P
 
:)
 
The biggest problem I experienced while moving back to php was writing variable types before the variable and writing constructors like public Name() lol
Could not help it for long time
thats why you should never focus on one language all the time
 
^ not completely true
good morning
 
12:45 PM
then i guess its just me ;P
 
@user3123545 That's like PHP4? :) You don't have to write visibility, but you should.
 
@TOOTSKI Like function(Controller $r) ? But you can't use visibility on declared variables can you?
Only in functions IIRC
 
@user3123545 That's type/class hinting what you wrote.
 
What's visibility then?
 
That's public/private/protected or PPP.
 
12:47 PM
Ah i get you
 
You can on variables and functions, in classes of course.
 
I have seen a function that looks like a javascript event in php, like
function(function() {
    });
What is it called?
I dont reeally remember the syntax, but it's in PeeHaa's chat system
 
you've just passed closure as a parameter
 
Is it not only a closure if you pass in something via. use ?
My guess would be it is really a lambda
 
$a = function (){};
var_dump($a); # object(Closure)[1]
:)
It's not lambda.
 
12:52 PM
Well what is the function making a closure over?
 
@RonniSkansing I don't know for sure, read more here: docs.hhvm.com/manual/en/hack.lambda.php
 
$x = 1;
$y = function() {
var_dump($x); // undefined
}
 
Yeah, read the link I've pasted.
 
bbiab
 
Idk what lambda is, but I know that it's added in java 8 and it's annoying me, epecially the syntax - I also dont get the point of it.
 
12:55 PM
@Levi let's plant alert('HACK SUCKS'); in manual pages and see if facebook will pull changes.
Is entire /vendor directory deleted by composer in some cases? I want to add some libraries that are not on packagist.
 
@TOOTSKI PhpStorm?
 

« first day (1275 days earlier)      last day (3666 days later) »