« first day (1706 days earlier)      last day (3228 days later) » 

ram
Guys how can i fetch a spaced record fronm the mysql database....eg:Big Bang in db table..hw to retrieve it with space...
 
@ram you mean there is a space in the column name ?
 
ram
column value...
 
Then it should Just Work™
Really must learn that alt code
 
@tereško interesting, but eih
 
ram
2:08 PM
@dave i'm not getting the value after the space
 
@ram The problem is something else. Either the column size is too small and your data was truncated when it was inserted, or you have some other problem with the logic in your code
Or maybe that space is actually a null byte and something somewhere is using it as a C string? That's pretty unlikely though
 
Or maybe he just needs to scroll to the right a little....
 
ram
@dave k if i pass this spaced data in my url will i get that xact one?
 
If the raw HTTP request contains a space in the request-URI then it's pot luck. Technically that's a protocol violation, so it would result in undefined behaviour - any sane server would just throw the request out with a 400, but some of them are not sane. It's possible that you'd end up losing the data after the space.
 
@DaveRandom Where's my access bro? Give me access bro!
 
2:18 PM
Screw it, just made it public
 
lol
 
Not even sure why it was private in the first place
 
Priceless!
Oh wait. They are actual codes. Everything has it :P
 
Yeh that will have been naming things based purely on the spec
 
I am disappoint
 
2:20 PM
oO
 
For a moment I thought you had your own random number generator :D
 
It's not actually code that was ever used for anything, so don't expect it to make much/any sense
 
public function __call($m, $args) { return 42 ;} //deal with it!
 
@PeeHaa hardcoded things (in this case, a file content) is a thing when implementing stuff :P
 
@FlorianMargaine What does a single quote do?
 
2:23 PM
@DaveRandom "don't evaluate what's coming after"
 
So, comment? Or something more abstract and lispy?
 
const value
 
if there weren't a quote, it would've executed the next form with the first symbol being the function name
in lisp, you do (foo "bar") to call function foo with argument "bar"
'(foo "bar") will just return a list with 2 elements
it really means "don't evaluate"
@DaveRandom if I didn't explain that well, I can try to reformulate if you want
 
@FlorianMargaine What is foo in that returned list then? A function pointer?
 
2:28 PM
@DaveRandom no, a symbol
symbols are first class in lisp
It's a little hard to grasp... and to explain
 
I... can't actually wrap my head around how you would make symbols first class and how you would then use them for things
 
have you ever used ruby?
sometimes you see :foo as a value
 
I've played with it a bit, but not enough to say I've "used" it
@FlorianMargaine Yeh, never seen that element of it
 
Damn :P
hmmm
 
That might be easier for me to grasp though, since ruby is a language that's closer to what I'm used to (at least semantically), do you have any refs to docs for that in ruby?
 
2:33 PM
(defun foo (bar)
  (when (eq bar 'baz) "something"))

(foo 'baz) ;; "something"
(foo 'qux) ;; nil
maybe that's a good explanation? ^
eq is the same as =
 
I get what that's doing, not sure why it's useful, in the sense that I can't see how that's any different from using a string
 
symbols can be namespaced
the :destroy symbol there ^
it could've been a string too
it's just more elegant, more statically verifiable, etc than strings
 
Right OK, sort of like using the names of enum members instead of just passing numbers to things that expect enums?
 
yes
the fact that it can be namespaced is a pretty big feature too
 
I like how PHP has support for Ruby-style atoms too.
 
2:38 PM
2 symbols from different packages (it's packages, not namespaces, but same principle) will not (eq)
 
[@foo => 'bar']
 
;-)
 
ruby-style atoms also would make this work though: ['foo' => @bar]
 
Are the C types unsigned char, unsigned short, unsigned int reasonably guaranteed to be 8, 16 and 32bits wide on the platforms that PHP runs on?
 
2:39 PM
@FlorianMargaine Which it does?
[@foo => @bar]
 
How do you get data from mysql based on location radius lat and long?
 
@DanLugg I don't think you can do if ($foo[@foo] === @bar) though
@Danack cc @NikiC @bwoebi
 
@FlorianMargaine Why not?
 
@DanLugg hmmm
@DanLugg won't it fail for [@foo => @bar, @baz => @qux]; $foo[@foo] === @qux; // true
 
@FlorianMargaine ......please could you not do that for me at least? If I get really stuck I can bug people.....but if they're not online, I almost certainly will have found the solution before they can answer.
 
2:41 PM
I mean, it shouldn't be true, and yet it is?
@Danack oh, ok. I think that only these 2 could answer though. Won't do it again
 
thanks.
 
@Danack yes. … I don't know about any support for 16 bit wide ints…
 
@Danack that said, can't we use stdint yet?
 
@Danack I'm online ^^ just wasn't watching the chat at that moment … so it's good that I was pinged :-D
 
you meant int32_t...
 
2:43 PM
@FlorianMargaine What?
 
@DanLugg I don't get how it works then :D
I thought it'd be constants
 
@FlorianMargaine Undefined constants become strings.
 
oooooh.
 
@bar looks up const "bar"
Fails, defaults to string "bar"
 
I see
ok, makes sense now
 
2:45 PM
@ just mutes the "I CAN HAZ NOT FINDZ THE CONSTANTZ! WE WILL STRING THE THING"
 
@Danack If it matters, best use uintNN_t (apart from unsigned char, which is guaranteed to be a single byte)
 
I got the first part, I misinterpreted the 2nd one though
 
I figured, I just wanted to say "string the thing"
lol
 
@NikiC so we can use stdint?
 
@FlorianMargaine Yes, of course
 
2:46 PM
@DanLugg huhu
 
@NikiC Isn't that only for C99?
 
We use inttypes all over the place
@Danack There are compatibility headers
 
oh, cool.
 
TIL according to some people to "bump" a post is to "bring up my post"
 
#TheMoreYouKnow
 
2:50 PM
#GIJoe
 
hello i have a login form.after form submit, if is there any problem in filled fields i want to redirect to it again with highlighting error fields.for example if user email already taken i want to set border color to red of email input field.what is the recommanded way??
 
@Gordon Use of undefined konstanz FOO - assumed [47.7083398, 9.1517065]
 
@DanLugg konstanz cannot be an array :P
 
@FlorianMargaine Why are you linking brainfuck stuff to me?? :P
 
Anonymous
3:02 PM
@FastSnail that has nothing to do with php. Better dig into javascript and event handling
 
@DaveRandom Looks like you gave up, endorse for ;-)
 
My routing namespace has 26 classes... I think I may have taken granularity to the extreme.
 
Is this 350 point HN article seriously telling people that Apple sucks because they use actual open source licenses instead of the GPL crap?
 
lol
seriously?
 
3:06 PM
@samaYo but the problem i shoudn't handle all error fields from js/ or Ajax.because form rederect to php page it check some errors from serverside if any error redirect to index page and error fields should be highlited
@samaYo only js solution is for that pass url parameter
 
user895378
> [[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
 
user895378
^ awesome
 
eih
 
Anonymous
@FastSnail yes, use server-side validation as additional solution. But, for what hou are asking can only be done in Javascript.
 
3:22 PM
Taking you up on your HN offer @rdlowrey news.ycombinator.com/newest (my username is inglor, arrow functions landed in Chrome)
 
user895378
Everyone with HN upvote that (please) ^
 
But that's jabbascrupt
 
Anyone that's used Ninite or similar; are there better auto-installers that maintain more developer-centric packages?
 
Under "File > Settings > Code Style" I've selected "use tab characters" and set it to 4 spaces. Yet, when I press backspace or left arrow after a tab, it doesn't go all the way back, just 1 space instead. How do I solve this?
 
hmmmmmmmm... hmm... hmmm 3v4l.org/ao4ZU
if I drop --disable-all do I still need to --with-readline ? #lazyweb
 
3:33 PM
@PeeHaa tss
@Danack "enemies"
 
Think I should be putting type hints on closures used for callbacks?
It doesn't serve a lot of purpose now, but it might actually be required in the future.
 
@PeeHaa Haven't you heard? The newest thing is jBrainCakeQueryLaraFuck on Rails. All the cool kids are using it.
 
@Trowski you mean SomeClass or int, string...?
 
@marcio Both (though only SomeClass for PHP 5 or course).
 
@Trowski No. Type decls are for defining how your API should be called, callbacks are using another API.
 
3:38 PM
@DaveRandom That's true, though I think @marcio was looking at implementing prototypes for callbacks: function doSomething(callable(int $arg1, string $arg2) $cb)
 
When, and only when, you are passing a callback to an API defined in this way would it be the correct thing to do.
 
I was just trying to make the code explicit, but the type hints aren't really necessary right now.
 
(IMHO)
 
@FlorianMargaine They "de-fun" things :(
 
@Trowski The issue is that you are potentially making life harder for yourself - it's unlikely your callback code needs to care about the actual types as long as the values are what you are expecting (talking specifically about STH here)
 
3:41 PM
Well, if you don't need to specify the args just use callable, it won't disappear. But when I need to use callbacks I'd prefer to see the types declared because you can get useful error messages.
 
When consuming someone else's API, you cannot assumed that they care, and are as careful, about types as you are. I don't see the value in it.
 
@LeviMorrison debian packages require a compat file with a magic number. Actually, many things require a magic number...
like ar/tar entries
aka sentinel values, I guess
 
Besides which @Trowski, type checks are not free, there is an implicit (tiny) performance penalty
 
> Callback expected X and not Y... instead of undefined method Y::something() called inside some callback on line ????
 
@marcio is the syntax @Trowski used above the syntax that you are working on?
If so, I'd prefer function doSomething(callable(int, string) $cb) - the $vars don't do anything useful while we don't support named params, and removing them for now doesn't preclude adding them back in if/when we do support named params
 
Anonymous
3:47 PM
@PeeHaa when will you be getting commentar back on track again?
 
this was discussed some days ago here and we got these points:
- what happens if there is no typehint? callable(,) - callable(_,_), callable($bla, $bla)?
- what happens to interfaces? do we allow argname omitting there too for consistency?
 
Tangential to this discussion, how do you (all of you) document callables with respect to parameters currently?
 
@marcio Q1: callable(mixed, mixed) or callable($, $) (preference for the former) and Q2: yes. Don't really understand why this is even a question.
 
@DanLugg docblock
 
@param callable(int $x, int $y) $callable
@FlorianMargaine Sorry, I meant what format?
 
3:52 PM
ah
good question
 
@DaveRandom that's a good question
 
@param callable(int, int) $f
@param callable(int $x, int $y) $f
^^ Either one?
 
@marcio I can't see any way in which it would make a difference. At the moment we don't support named params, so names are ignored in interfaces. And it's not a case of "allowing" them to be omitted, they shouldn't be allowed anywhere until we support named params...
 
how do I specify a recursive callable which expects itself as parameter?
 
(IMHO, YMMV)
 
3:55 PM
@DaveRandom TBH, we may not explicitly support named params, however names are relevant to reflection
 
@bwoebi I... er... wat?
 
@DaveRandom with the callable syntax?
 
@bwoebi callable(callable(callable(callable(callable()))))
 
callable(callable(callable(....???
@DanLugg not enough nesting.
 
Doesn't the same issue occur with recursive generics too? (where generics are supported)
Oh wait, no
 
3:57 PM
@bwoebi final class Foo { public function __invoke(Foo $foo) { ... }}?
 
@bwoebi you'll either need named types or we will need to come up with something like parent
 
@nikita2206 I think that's what typedefs are necessary for^^
 
see? a lot of collateral stuff to handle:

- introduction of anonymous variables $
- consequences for interfaces
- interaction with named parameters (RFC that will never be approved immo)
 
@bwoebi Maybe you could recycle $this for it? Can't think of any conflicts
 
They are not necessary for this, but they can solve the problem
 
3:59 PM
@marcio just callable($foo, $bar) That's the easiest and most descriptive.
 
@marcio I'm not seeing the interface problem, seems like a non-issue to me, do you have a concrete example of something problematic/ambiguous? The $ suggestion was just because mixed seems like the obvious answer to me, so I assumed that someone had objected to this with a reasonable argument
 
@bwoebi you mean to disallow types or allow omitting when type is specified?
 
@marcio I mean in case where we have no specific type
we should just use sanely named vars
I really want to avoid any need for mixed. It's awful.
mixed does not exist. only untyped values.
 
@bwoebi I think it should go like this: callable(mixed, mixed) is equal to callable($foo, $bar), usage of variable names is allowed, using variable names without typehint implies mixed as a type
 
@DaveRandom it's just because consistency. Function prototypes are interfaces in some way.
 
4:02 PM
posted on June 18, 2015 by kbironneau

/* by Jeevan */

 
mixed was reserved in 7.0 right?
 
@nikita2206 yes :'-(
But it doesn't mean that we have to use it.
 
@DaveRandom just to be clear. This RFC has interaction with many things already (conflicts with short closures - possibly type augmentation, union types, behavior with native functions), adding more is troublesome (existence of mixedtype or add $, consistency with interfaces).
 
But would be really handy
 
@nikita2206 mixed? I don't see how.
If something is accepting or returning anything, just don't add a type.
 
4:09 PM
I started reviving that branch btw, a couple of days ago. It segfaults now (at least compiles) with master, I'll probably find some time in sunday to work on it
 
hi everybody i am newbie in php i want have a server that my android's app can download files inside of server but i dont know what i must learn for doing it in php .
 
@nikita2206 mixed?
 
@bwoebi if I want a callback that expects two arguments, first of which is anything and second one is PDO
@marcio no, the thing overall :)
 
:) this will be a mailing list hell :D
 
@nikita2206 callable($describeWhateverThatParamDoes, PDO)
 
4:10 PM
I have a huge draft, I'm trying to dry it up now.
 
yeah I could use var name but what if I don't want to?
@marcio an RFC? you were working on typedefs right? We can join if you want
 
@marcio Personally I would go with callable(int $arg1, int $arg2) because the option to remove the parameters could always be done later, but I think you'll have an easier time passing it that way.
 
@nikita2206 you have to. I don't anyway se no benefit in not specifying it
 
I'm really not a fan of mixed... it would only seem necessary if we required a type hint on everything.
 
user895378
^ agree
 
user895378
4:13 PM
mixed is implied by the absence of a type
 
@Trowski exactly what I'm saying too.
 
@bwoebi E_TOO_MUCH_SYMBOLS - that's what I don't like in var names
 
@nikita2206 you mean the dollar symbol?
 
@nikita2206 Levi is with the typedef
 
@rdlowrey ty :D
 
4:15 PM
Well if variable name can be dropped while typehint itself exists - then that's probably fine
 
user895378
@BenjaminGruenbaum np ... that little rush of upvotes at the beginning gives you the kickstart you need to get something that's worthwhile off the "new" page and onto the front page.
 
I was seeing the case like this, which I don't like: callable(PDO $db, SomeService $serviceName) - I wouldn't want to specify var name for each of them in some situations
 
@nikita2206 it is indeed, and the consistency card is not so important anyway.
 
So you were working on a draft for callable types?
 
4:18 PM
If the argument wasn't required in the callable prototype, how would I specify a callback with one mixed argument? callable($value)
 
@nikita2206 yup (awkward moment)
 
@marcio did you write some code for it?
 
user895378
@LeviMorrison bump for leviathon benchmarking access when you have a chance (I know it's not a high priority -- don't want to hassle you)
 
@nikita2206 I saw the branch you shared and started to write a test suite to be published along with the RFC, but got too much work to do lately
 
Basically I want the feature, I don't want to fight anyone for it. So if you don't have the code let's just (I'll say it again) join our forces, if we have differences in our vision it can be resolved. So basically - let's not create two RFCs
I'll tell you when I finish it to some extent so we can both have a look
 
4:30 PM
What're the thoughts on omission of parameters in function definitions (specifically, closures)? In the same style as list($x, , $y)
 
@nikita2206 I thought that was the plan :) this feature is totally in my agenda so I don't mind going through all the debate efforts to pass it. Please, join in.
 
function reduce($collection, callable($value, $key, $result) $function) { ... }

$sum = reduce([1, 2, 3, 4], function ($value, , $result) { ... });
 
@DanLugg phantom arguments? totally bad immo, it's hard to read. I'd prefer to have $
 
I know its trivial in this case, but perhaps if the parameters aren't bound to on invocation, it could save performance in some circumstances? Let alone, the visual noise of unused params.
@marcio Okay, placeholders, etc., fair enough.
My point is as far as implementation, that he args aren't passed into func scope if the params are omitted.
 
@DanLugg well, that's what sucks about list()
 
4:34 PM
@DanLugg this is on my old RFC wish list gist.github.com/marcioAlmada/…
 
@bwoebi No, mixed would serve the same purpose as void*
 
@DaveRandom just that void* only accepts non-primitives...
bad comparison.
 
BTW if any one of you language designers feels like taking a look at github.com/benjamingr/RexExp.escape and giving it a review I'd be grateful
Especially those who are good at your RFC process.
 
@bwoebi Ignore the semantics, point is that it's a placeholder, it effectively does the same thing if you were to state it in English: "I don't care what the type is" and I personally would extend that with "...because I won't be using the value", which is basically the only reason for not caring about the type of something.
 
@bwoebi That behavior sucks?
 
4:37 PM
@DanLugg yeah
@DaveRandom uh, there are many reasons in C why you'd use void* and still be interested in the pointer…
 
yeah, like "polymorphism"
 
?
 
pass different structs with the same behavior
 
@FlorianMargaine then you usually have a common partial struct you cast to when passing.
 
@bwoebi Agree to disagree :-/
 
4:40 PM
@bwoebi or you pass a void*... void* > union sometimes, imho
 
@FlorianMargaine depends. But I accept that.
@BenjaminGruenbaum that's too formal for me :o (sure I understand it… but too formal.)
 
@bwoebi I think you can do fine, and I would appreciate your feedback and review - there is a .js file there :D
 
@nikita2206 when the draft gets "ready" I'll share with you first so we can discuss. BTW, did you notice any specific technical issue when writing the patch?
 
If you could share your PHP experience (cc @PeeHaa ) about escaping regex and escaping everything vs. a subset vs alternatives in an issue I'd appreciate it. Just title it "Review from bwoebi" and it'd be immensely useful.
 
@bwoebi I'm talking about PHP with the latter part, and also that's getting more into the design side of things than language-imposed restrictions
 
4:43 PM
@BenjaminGruenbaum I prefer the polyfill :-P
 
@bwoebi polyfill does the same thing :D
 
I know
 
just not as formally defined
 
just that the polyfill is much more intuitive ^^
@BenjaminGruenbaum It's basically just the preg_quote equivalent, right?
 
@bwoebi the readme says that :D
 
4:45 PM
oh
 
In other languages:

Perl: quotemeta(str) - see the docs
PHP: preg_quote(str) - see the docs
:P
 
@BenjaminGruenbaum lxr.php.net/xref/PHP_TRUNK/ext/pcre/php_pcre.c#1874 … btw. there are more chars to escape ;-)
or does Javascript not understand contructs like (?!o). ?
 
@bwoebi it does, but those are mutli-character context based characters. ! is escaped btw.
 
But what I'd really appreciate - is that you open an issue and ask these questions so I can show to the committee that I talked to people involved in other languages - I want your feedback but I also want everyone to see that you looked at it :D
 
4:47 PM
@BenjaminGruenbaum I don't see that ! is escaped?
 
links to the PHP src appreciated in the comment. Same for anyone else here in internals.
Oh right, ! is not escaped, but ? is because it has a meaning even without context.
 
yeah
 
@BenjaminGruenbaum Can't you just link to the transcript?
 
@DaveRandom much better idea :>
 
@DaveRandom our process isn't like yours, I can't just link these people to the transcript of a Stack Overflow chatroom
I need to make them buy this function - not vice versa
 
4:50 PM
@BenjaminGruenbaum Who are these people exactly?
 
The TC, TC39
 
@BenjaminGruenbaum wondering, can't you make the process be functional and non destructive? i.e. create a new list instead of appending to cuList
 
@BenjaminGruenbaum no, I rather mean… who are these people so that you can't link them to a transcript?
 
@BenjaminGruenbaum I'm almost getting the impression you're insinuating that some parts of the PHP project aren't run in a particularly professional manner, but that can't possibly be the the case since we are super professional all the time. Also, bum.
7
 
@BenjaminGruenbaum Do you have any resource that shows Origin header browser support for form submissions?
 
4:52 PM
@FlorianMargaine MAKE AN ISSUE asking that.
Please :D
@kelunik sorry, no idea. If caniuse failed you I can't help much
@bwoebi people like Brendan Eich and Douglas Crockford probably wouldn't open a site like Stack Overflow for a chat transcript they don't understand. The burden of proof is on me here
 
@kelunik I'm guessing caniuse.com/#feat=cors will be a pretty good estimation
 
@bwoebi you're asking me if I like that? No, but I also don't have a choice, while most of these people know who I am I'm not in the kind of standing with these people that you are with the PHP community, this is my first proposal for the language after all. Everything else was projects/frameworks
 
@BenjaminGruenbaum Yes, there's only CORS, but that's not necessarily the same as the header being sent on form submissions. Anyway, I'll just add a fallback to Referer and otherwise just fail the request and log the browser that doesn't support it.
 
is there any chance to make this an exception for PHP8? 3v4l.org/ifYdI
 
isn't the warning good enough?
 
5:00 PM
I think breaking bc for no reason wouldn't be great. There already is a warning
 
@BenjaminGruenbaum the algorithm is destructive for cuList, is what I meant
 
... oh you did, lol
 
@bwoebi :P
 
@FlorianMargaine but cpList is a new list, also where are we destroying it?
 
but reply in issue too ^^
 
5:01 PM
@BenjaminGruenbaum 5.i.a
this is a destructive action on cuList
 
We're appending to it?
 
@bwoebi IDK for most people, but for me it's a PITA not to be able to catch it.
 
Also yeah, on issue, and also @bwoebi and hopefully @PeeHaa
And anyone else in internals I want your feedback :D
 
5:20 PM
@marcio You can turn warnings into exceptions and catch it. But is there anything you'd really need it for?
 
@kelunik Other than "using a malformed regular expression is obviously exceptional", no.
 
@marcio also… maybe make it an error, but def. not an Exception.
 
It's clearly an error, but it's not really exceptional, but I don't want to bikeshed naming here.
 
@BenjaminGruenbaum ftr, non destructive would be cuList = cuList.concat(c);
 
@bwoebi if you meant catchable Error, that's what I wanted to say. I'm not used to Error yet :)
 
5:30 PM
I don't think they did, also set_error_handler all the things if you want all errors to be exceptions.
 
github.com/php/php-src/pull/1348 This may be a good idea
Apart from him using the wrong example, of course, len and val are two of the things I'd definitely keep exposed as is
 
Ooh @NikiC if you could take a look that'd be great too
 
@BenjaminGruenbaum I looked at it, but cannot tell you more than the character list looking reasonable.
 
@NikiC yeah, definitely… great idea for like… HashTables… but zend_string? no. zend_string is very likely to remain immutable...
it's a great idea, but I'm a bit annoyed how it makes code finally operating on that API less readable…
imagining zend_hash.h full of that…
 
@bwoebi yeah
 
5:42 PM
@NikiC can you make an issue saying that you reviewed it and you think that the currently escaped character set looks reasonable? (cc @bwoebi ) :D
 
^^
also, not 100% sure in what way it helps… when you then want to access it explicitly, I fear that you'd then just use the zend_strict API…
 
<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
a();
a();
?>
Can anybody tell me output
 
what do you think it will be?
 
@BenjaminGruenbaum let me try something first...
 
and as a hit, I suggest you format it better
 
5:56 PM
@ircmaxell that's what we just discussed about, 15 mins ago (scroll up a bit).
 
ah ok
 
@NikiC awesome, thanks a lot.
 
@NikiC I like the idea, but the implementation feels... weak and fragile (especially littering all member definitions with the strict declarations)
 
@ircmaxell yeah
Things like zend_hash.c would become very ugly
 
unless we move the struct definition into the .c file
 
5:59 PM
Mornin'
 

« first day (1706 days earlier)      last day (3228 days later) »