« first day (1464 days earlier)      last day (3500 days later) » 

3:00 PM
I know we have lxr, but it'd be nice to have an equivalence to referencesource.microsoft.com
 
hey @PeeHaa
 
yo
 
is there some kind of ternary operator in nginx configuration format? like I need to set fastcgi_param based on regex capture, but if it didn't capture anything then I need to provide fallback
 
So I kinda may have screwed up by burninating the branch :) I tried to merge manually, but I also screwed up that one (missing history)
 
3:02 PM
@AndreaFaulds Yea, I know. I suppose it doesn't translate as well, but the organization of assemblies -> extensions would be nice.
 
lol! should I open a new PR then?
 
Yes if you can against master that would be awesome :-)
 
Maybe it's just because PHP src is less abstracted.
 
will do in a few minutes, then
 
awesome :)
 
3:04 PM
@nikita2206 what are you trying to do? aka why do you want to do that?
 
@DanLugg Just look in /ext :)
 
@JoeWatkins in the install notes of apcu you say:
This version of APCu should work on PHP 4.3.0 - 4.4.x and
5.1.0 - 5.2.x.  Yes, that means PHP 5.0.x is no longer
supported.  Upgrade to PHP 5.1.x or 5.2.x and you will
notice all sorts of performance increases.
Why does it say that? Forgot to update?
I mean the - 5.2.x in specific
 
@Danack basically there can be two kinds of urls: `backoffice.domain/` and `domain/`
in server_name I have this: `~(www\.)?((?<is_backoffice>backoffice)\.)?domain;`
and I need to pass fastcgi_param based on is_backoffice, basically to do this, but nicely:

```
if ($is_backoffice == 'backoffice') {
fastcgi_param APPLICATION_ENV backoffice;
} else {
fastcgi_param APPLICATION_ENV frontend;
}
```
 
@nikita2206 That sounds like you are doing waaay to funky things in your server config imo :P
 
@PeeHaa I think it's cool that you can do it on web server level)
 
3:09 PM
@nikita2206 Yeah........no. That's working against the model that nginx likes. What you should be doing is generating your nginx config so that it repeats the information that is repeated in the two blocks, rather than trying to 'program' nginx.
13
A: Using variables in Nginx location rules

DanackYou can't. Nginx doesn't really support variables in config files, and its developers mock everyone who ask for this feature to be added. You should either write or download a little tool that will allow you to generate config files from placeholder config files. e.g. my nginx source config fil...

 
@nikita2206 Let me guess you are also a fan of coding in sql ;)
 
@PeeHaa I love SQL, this language has the highest expressiveness to readability ratio :) but I need to do all this stuff because I'm trying to get the already-written system to work... I just came to a new company so, ya'know
 
@nikita2206 yes, sql is great for storing data, implementing half of the application logic in sql not so much :-)
And yes I see where you are coming from. Gotta love those foster parent projects
 
@Danack So it's better to just create two "server"s? Or can I match against domain in "location"?
@PeeHaa had to deal with analytical system with queries of two full-hd screens height. Honestly I just kind of fell in love with sql after that :)
 
:D
 
3:16 PM
@Danack ah well I think I can't, so will stick with two server configurations
 
@nikita2206 Two servers, I think. The server name shouldn't be accessed in the location block
 
yep, thanks
 
@PeeHaa it's done. I now shall go back to being a father for the rest of the day.
 
@amenadiel hehehe sure. Thanks for fixing it!
 
@JoeWatkins did you invite FBM here? :))) (hint: @Vladd)
 
3:33 PM
@webarto I didn't but everyone's welcome
trying to sleep today because have to be up at 3am for podcast
not going well (I'm awake)
 
Sure, funny to see 3 current or former employees...
Where are you performing?
 
phproundtable with others
 
Also, Quaaludes :P
Ah, I'm out of the loop, sorry.
There's a seriously mean line up for @PHPRoundtable on Sunday; @ircmaxell @SaraMG @ramsey @auroraeosrose and @krakjoe. Shame its 3am GMT
 
that yeah
 
@JoeWatkins You haven't said that you'll be asleep then?
 
3:37 PM
nah, because everyone else is other side of the world ... I'd be in a minority ...
 
It's 3AM GMT, that means they're adjusting to him, it's not 9PM EDT-ish.
It depends on your POV :P
 
4:02 PM
@JoeWatkins you mean, you have to be up at 4am for the podcast…
or not, if the tweeter got it wrong :P
 
References in phpng suck. If I have two watchpoints which reference the same zend_reference and one of them is removed, how do I now know if I need to remove the watchpoint on the zend_reference too or not... (aka is there still some watched variable having this zend_reference?)
 
@JoeWatkins so I'll be one among the 3, maybe 4 europeans listening to that stuff (including you)?
 
4:25 PM
@ocramius listening live at least ;-)
@joe have you heard any details? I don't know what's going on...
 
not good at timezones, I thought 3am was right ... I'll be up all night whatever ...
haven't @ircmaxell
I think we just goto hangout, right ?
there is a timer on the video thing, it's 3am @salathe
 
I'd love to go on such a thing
but, 3am on a Monday...
no way
 
you can just come along ...
it's one night ..
 
I mean, I was able to stay up until a similarly ridiculous hour for PHP Town Hall... but I didn't have to get up for 9am :p
 
gotta take kids to school at half eight, but I've slept most of today ... they should survive :D
 
4:40 PM
I have an exam at 9am
 
oh I won't be getting tested ... that's different yeah ... shame ...
maybe we could write a patch for something to keep us awake ...
us/me
 
@JoeWatkins I'm having a lot of fun with references, refcounts and watchpoints :-)
 
I saw @bwoebi nothing useful to say, haven't really looked at the zend_reference thing yet
I'll just assume it's going to work ... right ?
 
It adds some more extra cases to be handled. Until now it was simple… just zval and ht. Now refcounts are in another pointer…
 
do we have an eta for master support yet, or too soon to tell ?
 
4:53 PM
I cannot say that it'd be bad what they've done, just harder to build watchpoints on them.
 
yeah, hopefully this doesn't happen too many times ...
 
@JoeWatkins when watchpoints are done. That's the only eta. I strongly hope I'll finish that in the next few hours…
 
just imagine what sort of trouble it would be if we go adding a jit :s
@bwoebi excellent stuff
so @ircmaxell have you thought about how we're going to get round the fact that we voted on anon classes before ?
 
Anyone know if something changed between MySQL 5.1 and MySQL 5.6 in such a way that a query that attempts to set the empty string into an integer column (auto-inc PK) used to work and now fails?
In particular, is there a setting to get the old behaviour?
It's hard to Google, I'm guessing there's some kind of strict casting setting but I can't find it
 
5:08 PM
@JoeWatkins It'd become impossible with a jit.
 
oh n/m STRICT_TRANS_TABLES is enabled and hiding from me
 
well not impossible, a lot of the implementations I have looked at do actually include debugger backend stuff, but it'd make everything more complicated for sure .. much more ...
 
@JoeWatkins well, you'd just turn the jit off during the debugger run… ;-)
 
5:33 PM
There is a difference between non-blocking and asynchronous. Non-blocking means that control can be given to another function at a well defined moment (like yielding in Amp). Asynchronous means the other function can be called, regardless of the current state of the program.
These terms are misused all the time. Why?
(well, technically non-blocking is more like: it returns and then a scheduler chooses another thing to execute and later enters the function again/executes the thenable, whatever; but that thing should usually be hidden from you by a good non-blocking library)
 
Hey guys, do you know examples of applications that do not require persistent data?
 
5:49 PM
@ziGi Well, anything over HTTP doesn't require persistence since it's a stateless protocol. Usually that's not very useful, however.
 
true
 
Though it depends on what you're persisting. For example, your server can persist the web server's access logs, which retains information about visitors. Though the client isn't required to persist data sent from the server over HTTP, though they can.
 
any one firm with PHP DateTimeZone? I've got a problem with UTC offsets. (stackoverflow.com/q/26453510/367456)
 
eeekh
don't use offsets
 
@hakre Why do you want to get the offset?
 
5:53 PM
Your timezone database is likely out of date.
This is what happens when you don't head warnings in the documentation us3.php.net/manual/en/timezones.others.php ;)
 
class Outer {
    protected $data;

    public function __construct($data) {
        $this->data = $data;
    }

    public function getArrayAccess() {
        /* create a proxy object implementing array access */
        return new Outer implements ArrayAccess {
            public function offsetGet($offset)          { return $this->data[$offset]; }
            public function offsetSet($offset, $data)   { return ($this->data[$offset] = $data); }
            public function offsetUnset($offset)        { unset($this->data[$offset]); }
nicer I think ...
 
is there a preference to use phpmailer or swiftmailer for a newbie?
 
I can't move ctor args without making conflicts ...
 
@Danack I need it for comparison against RFC2822 which has these for the obsolete parsing.
 
I like it this way, same as closures ... but people moaned last time about that ...
 
5:59 PM
@JoeWatkins wouldn't new ArrayAccess {} be better?
 
no it's a subclass of Outer, so the anon class extends Outer and implements ArrayAccess
yo @Vladd :)
 
@JoeWatkins oh okay. for me it looked like you named the anon class by the name "Outer", nothing like extending...
 
yeah ... I think new class extends Outer implements ArrayAccess is clearer, but also, really verbose ...
 
@Danack like here:
   EDT is semantically equivalent to -0400
   EST is semantically equivalent to -0500
and so on and so forth.
I had the idea to re-use the timezone information from within PHP to cover these and all potential other time-zones to keep the parsing as lax as possible.
 
EST isn't really EST in PHP. It's not even a real timezone.
 
6:03 PM
yeah, yeah - that's a perfectly good reason to need to fiddle with them. Sometimes people use them for less good reasons.
 
"Please do not use any of the timezones listed here (besides UTC), they only exist for backward compatible reasons."
 
@TumblrGuy (new DateTimeZone("EST"))->getName() does not throw any exception and returns "EST". So you mean that DateTimeZone is not a real timezone?
 
Please read the documentation people.
 
@TumblrGuy ^ why does it return an offset then?
and how is HHVM able to manage this without any problems?
 
See EDT is really this thing called EST5EDT, which isn't going to give you what you expect, and for good reason. EDT/EST are stupid. They don't represent Olson TZDB identifiers. They aren't useful in the practical world.
 
6:06 PM
can't imagine they have super powers.
 
sighs
READ THE DOCS I JUST POINTED YOU TO?
 
sure, just wondering that for backcompat reasons PHP makes EDT that EST5EDT zone you mentioned.
 
As for HHVM I wouldn't ever follow suit on anything they do. They very often implement PHP wrong and that's fine for them. However, you can definitely update your timezone db as suggested earlier.
 
we should only use UGT anyway
 
@TumblrGuy I don't follow them suit, just trying to find out more.
 
from what you write, it seems anyway I need to make own translation tables.
 
No, and if that's what you got then you got nothing of what I said.
From what I wrote, you shouldn't be using EST/EDT at all. They are useless in the real world.
They aren't real timezones.
The timezones that PHP relies on come from something called the Olson Timezone Database, which is made up of global timezone identifiers that look something like America/New_York
 
@TumblrGuy please take a look here: tools.ietf.org/html/rfc2822#page-32 (lower half of page 32)
 
That timezone doesn't change when DST kicks in. However, its recognition of DST does.
There's a difference.
America/New_York is always useful. EST/EDT only useful when you know whether DST should apply or not, or whether or not you care.
Geographically, however, they are utterly useless antiquates.
 
@JoeWatkins well, new Outer implements ArrayAccess is fine, you just have to get used to its meaning ;-)
 
6:16 PM
@TumblrGuy He isn't setting the timezone. He's getting the timezone from an external data source. Just saying don't use that timezone isn't very helpful.
 
@JoeWatkins Just wondering how to create a class implementing two interfaces without parent class? new ArrayAccess implements Iterator or new Iterator implements ArrayAccess … well… weird…
 
new class implements Interface1, Interface2 {}
@bwoebi ^
 
@Danack No, but explaining to someone that they aren't reliable in PHP is.
Don't rely on things PHP documents as being unreliable and you can steer clear of trouble.
 
@hakre I think possibly you will need to 'translate' from the bogus timezone to a standard timezone - e.g. stackoverflow.com/a/4989293/778719
The standard timezone should be reliable to use.....I think?
 
Yes, all of the timezones listed here us2.php.net/manual/en/timezones.others.php with the exception of UTC, are unreliable.
Simply because they do not carry the kind of information PHP depends on to make things like DateTime and DateTimezone work they way they are documented to work.
 
6:32 PM
@Danack I will translate to the semantical equal meaning that is documented with a translation table, I just thought I could use DateTimeZone for out-of-band information but after what turned out, I will put that into the back.
 
6:42 PM
@TumblrGuy What happened to googleguy?
 
@JoeWatkins that gets verbose again, not sure if I like that…
@JoeWatkins what about new Interface1, Interface2 {}?
 
kinda strange ...
 
Not stranger than new Outer implements ArrayAccess appears to me…
 
hi.
 
evening
 
7:00 PM
evening @NikiC
 
@NikiC Hi
Last week there was a bunch of discussion about whether the strict cast functions (to_int, to_float, and to_string) should return null or false on failure. I didn't jump in at the time because I was busy and also wanted to give it extra thought. @AndreaFaulds @LeviMorrison @NikiC
Upon further consideration, and also testing usage in actual code, I've come to the conclusion that throwing exceptions would be the right approach.
1. Exceptions provide more information (e.g. invalid type vs. overflow)
2. Usually you want an exception anyway. If we use an error return value then lots of code will be wasted checking whether a value is invalid and then throwing a custom exception:

$idInt = to_int($id);
if ($idInt === false) {
throw new Exception("$id is not a valid integer");
}
3. Throwing an exception is safer. For example, strpos($haystack, $needle, to_int($offset)) would thrown an exception rather than silently converting $offset to 0 if it can't be safely cast.
4. There is already precedent for this in other languages. For example, Convert.ToInt64() in C# throws a FormatException if the string does not have valid syntax, or an OverflowException if the value is less than Int64.MinValue or greater than Int64.MaxValue.
5. @LeviMorrison made a good point about mixed return types being bad. If we get scalar return type declarations in the future it would be nice to be able to use them with these functions.
The Safe Casting Functions RFC draft mentions the rational for an error return value, which I'd don't think is very good :) The RFC states that "An error return value was chosen instead of an exception to make chaining easier, and because checking for FALSE is easier than checking if an exception was thrown."
The problem with this argument is that most of the time there is no need to check whether an exception occurred each time a value is cast. If an exception occurs, it will be caught by the same handler used for other exceptions in the scope. Chaining is not any easier without exceptions, it only makes it more difficult to see where an error occurred and what the error was.
I have a branch with throws exceptions in my userland implementation which can be viewed here: github.com/theodorejb/PolyCast/blob/use-exceptions/lib/…
What do you guys think? @AndreaFaulds @NikiC @LeviMorrison @ircmaxell
 
Now THAT'S a wall of text.
 
Sorry :-\
I thought of a lot of points :)
 
7:22 PM
morning
 
@TheodoreBrown My main gripe with throwing an exception is that it's very likely that it's not the exception that you want, i.e. you will usually end up catching and rethrowing.
You typically don't need an exception with "Invalid integer", but an exception with "Number of items must be an integer"
Assuming we're talking about user-facing code here
 
@TheodoreBrown You possibly should have started with "If we get scalar return type declarations in the future it would be nice to be able to use them with these functions." - that's the most useful thing.
 
and in the rethrow scenario (which in particular also requires catching each individually) it requires a good bit more boilerplate than checking the return value
 
also if an exception unexpectedly throws from somewhere, this doesn't make code more stable.
 
@NikiC That is how all exception handling is done though? Catch an exception that has programtic meaning and turn it into one with 'business' level meaning. "it requires a good bit more boilerplate" Depends on how you write the code surely....and it doesn't seem that much difference:
$foo = to_int($bar);
if ($foo === false) {
   throw new BarMustBeIntegerException("Bar must be valid int");
}
vs
try {
    $foo = to_int($bar);
}
catch (IntCastException $ice) {
    throw new BarMustBeIntegerException("Bar must be valid int", 0, $ice);
}
E_TOO_JAVA though.
 
7:33 PM
if (!to_int($bar, $foo)) {
   throw new BarMustBeIntegerException("Bar must be valid int");
}
returns number of values converted: 0 or 1.
compare sscanf etc.
 
@hakre Eww.
 
@TheodoreBrown only when you don't use the second parameter.
if the library function already has taken the decision whether or not it throws an exception (and you want it for subjective preference), then it's most likely a sign of premature optimization as error handling via return has brought up as well.
 
@Danack if (false === $foo = to_int($bar)) usually, so you end up with a 3 line diff ^^
 
@NikiC now how would that work for to_bool (or ain't there such a thing?) :)
 
@NikiC eww.
 
7:40 PM
@hakre no such thing
Also, throwing an exception here is wrong because it's not an exceptional situation
On the other hand, the "return only one type" argument is also good
 
then it's very nice I'd say.
well FALSE represents the exception which can be easily caught for those three.
the only thing that won't work is that you throw in some to_int and let it there. Then some day suddenly the exception goes up and you can rest assure that the code after is not executed at least.
without exception, a single call wouldn't do that.
 
@NikiC I disagree. Wouldn't you almost always immediately throw an exception if to_int returned false?
 
@TheodoreBrown if you're an "exceptions for control flow" kind of person, yes
 
@TheodoreBrown me personally not.
 
@TheodoreBrown no...you can have valid defaults for missing/bad data.
and "user inputting something that is not valid" is not an exceptional circumstance.
 
7:48 PM
@TheodoreBrown ditto
 
for the record I'm an "exceptions for control flow" kind of person - but it doesn't really apply here.
 
See, I was in favour of returning NULL, but actually I think exceptions work out better now
they avoid explicitly checking every single cast
 
And although my instinct is that exceptions would be nice here, I've made fun of Java for doing exceptions in non-exceptional circumstances far too many times to advocate using them here.
 
@Danack In this case I'm in favour from a practical point of view, not philosophical. I agree they, ideally, should only be used for exceptional circumstances
 
@AndreaFaulds you still need to check every single cast for error messages
 
7:50 PM
@AndreaFaulds wait. Really now? I thought @NikiC just explained well why exceptions are a bad idea…
 
which is why a false return value is more practical. it simply requires less code
 
21 mins ago, by Danack
@TheodoreBrown You possibly should have started with "If we get scalar return type declarations in the future it would be nice to be able to use them with these functions." - that's the most useful thing.
 
@Danack Returning false is compatible with scalar typehints (strict ones that is)
 
@AndreaFaulds you still need to check every conversion for multiple inputs. An exception for example could message that parameter A in accordance with B does not work.
 
@NikiC But you wouldn't be able to do static analysis on the code where it is using a mixed type to call a function that expects an 'int' param.
Unless the static analysis code was very smart.
 
7:52 PM
@Danack I would argue that /users.php?id=12.5 is an exceptional circumstance. Typically a user wouldn't be setting this in a URL, the URL would be generated in an application.
 
@Danack not sure what you mean there?
 
but that remains a detail of the implementation. the library should not make that distinct assumptions of it's use. OCP.
 
@TheodoreBrown in that case maybe. if you do the same thing in a form, no.
 
@Danack That's definitely not the worst point of Java. I prefer making fun about having to search at all the layers of object hierarchy (which then ideally call some handler identified by a string and defined at some unknown place…) to get the workings of a single method...
 
@NikiC to_int, to_float, and to_string can never replace proper form validation, no matter what they return/throw.
 
7:53 PM
@TheodoreBrown no. User input is never an exceptional circumstance. Only internal (server-side) failures are.
 
@TheodoreBrown why can't they? I think to_int sounds like a great way to validate integral form fields
but as @bwoebi said, if it's user-input it's not really exceptional in any case
 
process(int foo) {...}

try {
$foo = to_int($bar); //returns int
}
catch(IntCastException $ice) {
$foo = 4;
}
process($foo); //Static analysis shows $foo is always int
$foo = to_int($bar); //returns false|int
if ($foo == false) {
    $foo = '4';
}
process($foo); //Static analysis has to analyze the code
/again, fu markdown.
 
@Danack static analysis also has here to check if $foo really is assigned an integer in the catch block.
 
@Danack As far as PHP is concerned, I think the only reasanable type analysis is if the possible types of the argument and the possible types of the parameters are disjoint sets.
 
@TheodoreBrown It would be in some cases, but not universally. And something has to be a universally exception event to justify throwing exceptions, otherwise you should just catch the error where appropriate and throw an exception where necessary.
 
7:57 PM
@bwoebi So you never throw exceptions for bad user input? In my experience this is by far the best approach. A top-level handler can catch the exception and show a friendly error to the user.
 
That would reject takes_int(to_float($x)) and accept takes_int(to_int($x)) - even though the latter could be invalid, but we can't know.
 
@bwoebi No, both code paths assign an int - so there is no ambiguity about the type.
 
@Danack '4' is not an int
 
@Danack if it's checked for false, also all code paths are assigned an int…
 
@NikiC Fark - I meant 4.
 
7:58 PM
@Danack with the 4, static analysis should be quite capable of determining that it can only be an integer afterwards. But as said, I don't think it's very useful information
 
Meh - I like static analysis so that I can detect that things like takes_int(to_float($x)) are errors in the code before it's even run.
 
@TheodoreBrown well. I verify user input at the top-level usually and then pass it forward via normal variables. So no need to throw any exceptions.
 
@Danack that was an example of what can be safely and easily detected, without exceptions.
the takes_int(to_int($x)) was the example of what isn't detected - and I don't think it should be.
 
Also, the coalesce operator plays nicely in here... takes_int(to_int($x) ?? 0) voilà...
(if we return null)
 
@AndreaFaulds I guess I just forgot that's how it works. And on top of that, that's how it should work
 
8:02 PM
If to_int($value) returns false on failure, you won't know whether it was because of an overflow, invalid syntax, incorrect type, etc. And the error can be easily lost if it isn't explicitly checked for. Exceptions are much more useful.
 
Note: I'll take functions regardless of whether they throw, return false or return null. I think all options have their benefits and none is a lot worse than the others. Wouldn't want this to be blocked based on error case bikeshed
 
@TheodoreBrown (with top-level I mean here the level where it's clear which handler is going to be used)
@NikiC Just a question: what's the advantage of false versus null, except it doesn't play nicely with coalesce operator?
 
@bwoebi false plays nice with nullable scalar typehints instead
it was judged that compatibility with typehints is more important than null-coalesce
 
oh, … wat :o
 
@TheodoreBrown I think the best argument for exceptions is that it will play nice with existing, sucky "scalar typehints" used by internal functions. It doesn't matter for strict userland hints, but it does for internal ones.
 
8:07 PM
@NikiC well, IMO, when ever we introduce userland scalar typehints, internal typehints should be the same ones than userland and so it shouldn't be an issue.
 
@bwoebi that's impossible due to bc
strict types for internal functions will never happen
 
@NikiC like introduce an E_DEPRECATED in PHP 7 when it's not matching strict typehints in internal functions and then in 4 years or so for PHP 8, change it into exceptions…
 
@NikiC Yes, this is basically point #3 in my list.
 
@TheodoreBrown good point, I missed that
@TheodoreBrown I'd say you convinced me ^^
 
@NikiC :)
 
8:09 PM
Wondering if something like to_int($_POST['items'], 'Items must be an integer') make sense. Probably not
 
@NikiC I thought of that too but it seems out-of-place
 
That could be done in user land trivially?
 
@Danack yep
which also applies to the whole discussion tho ^^
 
@NikiC True, since I'm making a userland implementation. But if we're ever going to get scalar annotations I think it's important that safe casting functionality be built into the language.
Time for dinner, back later.
 
@JoeWatkins where is the source code for phpdbg website? I'd like to help to improve the docs...
 
8:21 PM
@FlorianMargaine not publicly available
 
k
any reason not to use jekyll in a gh-pages branch? Laziness is a valid reason.
 
@TheodoreBrown I was referring to the error-condition part. No matter what we implement internally, userland can easily provide a wrapper with the preferred mechanism for handling failures
 
actually docs should be in the php manual, best to write in docbook format and commit there ...
 
@FlorianMargaine Because Jekyll is a horrible piece of software.
 
@NikiC it's well integrated into github though.
as long as user experience is fine, I don't care
I mean, we're all php users here...
 
8:24 PM
@FlorianMargaine Given the amount of times I had to fight Jekyll already, I think it's easier to write your own static site generator than make Jekyll work, long term
 
oh? I run my blog on it, never had issue
 
I don't blog much, but when I do most of the time is spent fighting Jekyll
 
to each his own I guess, but Joe's point stands anyway: it should be in the php manual :P
 
@NikiC Word.
 
@JoeWatkins agree. We really don't need that website there…
 
8:29 PM
having a website is nice, but since we are developing for 7 in the php-src tree we should probably move all docs to the php project too ...
 
why are the sources not in php-src either btw?
I mean, why don't you develop phpdbg straight in php-src?
 
Because people don't do that......avoiding small commits in a project if PHP size is good.....and it avoids breaking PHP-SRC when people need to ask for help on a bug.
 
shouldn't most exts have their own git repo then?
 
I guess, maybe. Most exts in core predate git though. But people are still free to work on their own repos before pushing to php-src.
 
@ircmaxell I just got show notes ...
 
8:39 PM
Anyone know if there's a compile option like with-config-file-path for php-fpm to tell it where to look for php-fpm.conf?
 
./configure --help | grep fpm
 
this question needs 436 more visits for a nice screenshot: stackoverflow.com/questions/40100/apache-license-vs-bsd-vs-mit
 
@JoeWatkins you'll run the podcast at 4am?!
 
yeah, why not ...
 
well, I sleep at this hour
 
8:50 PM
@JoeWatkins Thanks...it turns out it's just --sysconfdir=/etc .
 
@FlorianMargaine because it initially wasn't in php-src at all (only since the RFC passed) and then because php 5.4/5.5.
 
@bwoebi if it's master/PHP-5.6, php 5.4/5.5 doesn't matter. And since it's in php-src now... it just seems inconsistent with the other exts/sapis
 
@FlorianMargaine well, it's just for the 5.x branch where dev happens in krakjoe/phpdbg. For 7 dev will happen in php-src itself.
 
9:49 PM
@JoeWatkins well. Watchpoints are getting harder than expected. I assume I won't be able to push anything there before the end of week :-(
I now need watches which are only indirect. Also, when dumping strings etc. I now need to store the string before change… these things are now delocalized etc. :-(
 
10:12 PM
- What a freaky query - thought the database and stopped working.
ahahaha :D
Man there are gonna be some awesome things in PHP 5.6
 
10:41 PM
ev'nin
 
ev'nin
:)
 
ev()
 
hmmm... searching an array of 1 million integers: 0.002928 s...
searching a binary tree of 1 million integers: 0.000105 s...
 
yeah
binary tree is log2(O)
what do you expect
 
The problem is: adding 1 million integers to the binary tree costs 4.459887s whereas the array only costs 0.026691s
 
10:51 PM
basically you divide the seach number by 2 every time
@TumblrGuy there is always a trade-off
it's like an array and linked list
you have to choose depending on the situation
@TumblrGuy I would recommend priority queue
it is the fastest
since when you insert a value it takes more time than an array
but it is less than a tree
 
No, I'm just trying to determine if the performance benefits of a binary tree are enough to justify adding it to PHP.
 
and it is faster to search because it is again log2(O)
@TumblrGuy what do you mean adding it to PHP? are you responsible for that?
 
Most use cases for a binary tree entail that the structure remains in memory as data is constantly added-to or removed-from the tree. PHP's use cases almost never exceed the span of a few milliseconds.
 
yeah
why do you need a binary tree if you have a priority queue?
 
Just trying to figure out a real world use case where the cost-savings of search far exceeds the cost of instantiating such a large tree in the first place.
 
10:56 PM
@TumblrGuy except daemons
 
@CSᵠ That's such a taboo thing in PHP
 
shouldn't be anymore
 
@TumblrGuy in the worst case binary tree becomes with complexity O(n)
while a heap it is always O(log(n))
 
No, it's worst case is O(log n)
Binary tree can never be O(n), can it?
 
yes it can
imagine everything falls on the left branch only
 
10:58 PM
How would you ever get to n?
 
then you get a linked list
 
That would be an incredibly rare scenario, but OK. Didn't think of that.
 
In computer science, a binary search tree (BST), sometimes also called an ordered or sorted binary tree, is a node-based binary tree data structure where each node has a comparable key (and an associated value) and satisfies the restriction that the key in any node is larger than the keys in all nodes in that node's left subtree and smaller than the keys in all nodes in that node's right sub-tree. Each node has no more than two child nodes. Each child must either be a leaf node or the root of another binary search tree. The left sub-tree contains only nodes with keys less than the parent node;...
Man I used to go to algorithmic competitions
and I remember that I have read quite a lot about it
because sometimes you get really long branches
so it starts looking more like a few linked lists coupled together by some nodes
 
Hmm, my C implementation is not much better than my native PHP implementation so far. Gotta find a better way to do in order traversal in balancing.
 

« first day (1464 days earlier)      last day (3500 days later) »