« first day (1462 days earlier)      last day (3501 days later) » 

2:00 PM
blah
> OK (2 tests, 2000 assertions)
3
 
Static property access bug that maybe I introduced.
 
E_NOT_ENOUGH_ASSERTION_PER_TEST
 
eih
 
@ircmaxell LOL
 
why LOL?
 
2:05 PM
what the hell do these tests look like
1000 assertions per test is pretty loly
 
ah...
that's cheating :(
 
posted on October 17, 2014 by kbironneau

/* by codevinsky */

 
that ^
 
2:09 PM
@DaveRandom wut
 
@AndreaFaulds much like breaking tons of shit without a good reason ;)
 
@Leigh Are you saying the bigint patch does that? Because it doesn't.
It breaks a lot of tests, sure, but PHP has a lot of poorly-written tests.
 
ok, catch ya all on the other side of the Atlantic
 
catch you later :)
 
@ircmaxell lol
 
2:12 PM
@AndreaFaulds it prevents integer wrapping?
 
@Leigh Integers never wrapped. If you thought they did, you perhaps shouldn't be commenting on this RFC as you clearly are unaffected by the overflow behaviour, given you don't even know what it is!
OK, that's a bit harsh, but integers do not wrap in PHP. Maybe they did in PHP 3 or something, but they certainly don't in 5.
What this RFC does is give you a free precision boost. Rather than overflowing to float and losing 12 binary digits of precision, you retain full precision. This means you can have a 128-bit DB id or something and everything works just dandy.
 
what does var_dump((int)(PHP_INT_MAX + 1)); give you?
 
Depends on your system
 
does it correctly wrap negative?
 
In current PHP, that's either -0x800000000 or -0x80000000000000000
 
2:17 PM
I know what it is, I use the "features" of ints all the time
 
Under the bigint RFC, that's PHP_INT_MAX + 1.
 
so you broke stuff
 
Sure. Not for no gain, though.
 
so be equally harsh, if you can't understand why you're breaking stuff, maybe you shouldn't be writing this RFC ;)
 
I understand why I'm breaking stuff. I dispute that there's no gain.
 
2:19 PM
I dispute there's a gain, we have ext/gmp
how is sign extension handled with your patch?
 
Same way it is usually...
 
how about dechex(-1); ?
 
Haven't gotten round to touching dechex yet.
 
What happens when a SyncEvent is fired? Could I run a function?
Are there any dependencies for SyncEvent in Debian Wheezy PHP5?
 
sorry, we have bigint support in the form of an ext, and I need to retain existing int behaviour, don't assume people don't know what they're talking about.
 
user895378
2:22 PM
morning
 
@Leigh Sorry about that. I assumed you thought ints wrap on overflow.
 
explicitly cast so they don't become floats, they do
 
@rdlowrey for me its evening..
 
user895378
@GeoffreyMureithi For everyone who observes Universal Greeting Time it's morning :)
 
user895378
 
2:25 PM
@rdlowrey moin :)
 
@Leigh Er... not quite, no.
They become floats, lose accuracy, and are then converted back to ints.
 
@rdlowrey :) so, whats up then? do you agree with @DanLugg that PHP will suck forever?
 
You're throwing away 12 bits there on a 64-bit platform.
 
user895378
@GeoffreyMureithi I think everyone who has contributed to php-src probably believes PHP Will suck forever :)
 
user895378
But seriously, all programming languages suck.
 
2:26 PM
@rdlowrey i no rite? And I haven't even contributed.
 
user895378
All we can do is gradually work to improve them and make using them a nicer experience.
 
@Leigh What's the point of overflow when you lose the least significant bits?
 
@rdlowrey Whoah there big fella, that's a mighty bold statement to make with languages like D floating around...
 
Depends how much you overflow by, existing code that works within the current constraints is going to be broken
 
@DanLugg So basically, you want the D?
@Leigh No, you always lose the least significant bits.
 
2:28 PM
@AndreaFaulds All D all the time. I want the D at work, I want the D at home, I want the D everywhere.
Did I... did I euphemism?
 
@Leigh What do you think (int)(PHP_INT_MAX + 25) produces?
 
Someone please explain to me why this and that do not fail with bad property accesses.
This should not be allowed unless there's some critical piece I'm missing.
 
yea true @rdlowrey but I believe that how good or sucking a language is, is personal.
 
@LeviMorrison Wait, parent classes can access protected child class properties?!
 
That would make sense if it existed in the parent, but in these cases it doesn't.
 
2:30 PM
@DanLugg lol! The D everywhere?
 
:-)
 
@LeviMorrison I bet that's unintentional, but it's unfortunate. Any way to check if anyone relies on this? (probably quite difficult)
@Leigh Hello?
 
@AndreaFaulds yes ok that falls foul of the int -> float -> int thing. What do you think PHP_INT_MAX << 1 produces?
 
@Leigh presumably 0b11...0
Which would be -2 currently because I just checked the result. Bigints would affect that.
oa-res-26-28:php-src ajf$ php -r 'var_dump(PHP_INT_MAX << 1);'
int(-2)
oa-res-26-28:php-src ajf$ sapi/cli/php -r 'var_dump(PHP_INT_MAX << 1);'
int(18446744073709551614)
 
2:33 PM
Anyone know how if in Artax I go to a url with a redirect I can find out the URL I was redirected to? tag @rdlowrey
 
I use shifts for mul/div by powers of 2 a lot, so you're breaking things
 
@Leigh But this means << is always actually a mul/div by a power of two.
 
@Levi, I agree. But it does sort of make sense. If you suspend sanity and logic...
 
oa-res-26-28:php-src ajf$ php -r 'var_dump(PHP_INT_MAX << 1);'
int(-2)
oa-res-26-28:php-src ajf$ php -r 'var_dump(PHP_INT_MAX * 2);'
float(1.844674407371E+19)
oa-res-26-28:php-src ajf$ sapi/cli/php -r 'var_dump(PHP_INT_MAX << 1);'
int(18446744073709551614)
oa-res-26-28:php-src ajf$ sapi/cli/php -r 'var_dump(PHP_INT_MAX * 2);'
int(18446744073709551614)
 
not helpful for existing code that relies on the the truncating behaviour
 
2:35 PM
@ircmaxell I guess the next step is find documentation somewhere. /cc @AndreaFaulds
If it's a documented behavior that sucks
If not then this would be great to fix in PHP 7.
 
++
 
Even if it is documented it might still be good to fix in PHP 7.
 
And if we fail to ban it, we could always E_STRICT right?
 
> Members declared protected can be accessed only within the class itself and by inherited and parent classes.
 
Oh great, it's documented...
@ircmaxell @LeviMorrison Don'tcha just love spooky action at a distance?
 
2:37 PM
I really wish php supported multiple inheritance.
 
@GeoffreyMureithi No you don't.
flashbacks to C++
 
@GeoffreyMureithi I'm really glad PHP doesn't support multiple inheritance
 
Oh no
 
@Danack C++ is cool
 
@GeoffreyMureithi And MongoDB and node.js are web scale
So, the real reason multiple inheritance isn't allowed isn't the Diamond Problem. It's that it's incest.
 
2:41 PM
morning
 
C++ has no morals or ethics!
Good morning @NikiC :D
 
@AndreaFaulds I see.. I am actually learning node.js
 
SHIT, @DAVERANDOM, YOU NINJA'D ME
 
?
oh right lol :-P
 
I WAS WONDERING WHAT THE HELL THAT WAS ALL ABOUT TBH... THEN I SAW DAVE'S MAIL AND FINally realized...
 
user895378
2:46 PM
@Fabien One sec, there's a way ...
 
It really pisses me off that, it's in the same league as "halp it's urgent"
 
user895378
@NikiC morning
 
As if typing in block caps will somehow make people listen to you more
 
@AndreaFaulds why not use C3 linearization
 
user895378
@AndreaFaulds Non-blocking is the secret in the async sauce.
 
2:47 PM
@PHP_CEO, PHP
CEO OF A PHP COMPANY
120 tweets, 13.3k followers, following 0 users
I'd hate on MySQL but I'd be hypocritical if I didn't hate on PHP at the same time
Because they're both awful for very similar reasons
 
this one was epic
OK WHO HIRED THE ENTIRE PHP INTERNALS TEAM TO NAME MICROSOFT’S NEXT OS
4
 
LET ME ASK YOU THE SAME QUESTION BILLIONAIRE LARRY ELISON ASKED ME WHEN WE FIRST MET: “WHO ARE YOU HOW DID YOU GET ON THIS BOAT”
someone explain to me what php.net/manual/en/syncevent.construct.php is all about
 
@GeoffreyMureithi Well, SyncEvent::__construct — Constructs a new SyncEvent object
 
Someone else asked this yesterday ^^
 
2:57 PM
Oh, that ~~useless~~ pecl extension of limited usefulness to non-low-level devs that someone wanted shoehorned into PHP7?
 
When in doubt of the PHP manual, navigate to the right, and keep traversing up the tree to "Introduction".
6
 
@Naruto Never was to begin with, but I can try :)
 
@AndreaFaulds ---
 
@NikiC Yes, but I'm not allowed to edit it now.
NOBODY EVER GOT FIRED FOR BUYING IBM EXCEPT OUR INTERN JERRY WHEN HE WAS TOLD TO GET NEW LAPTOPS FOR THE IOS DEVELOPERS
COMPANY CULTURE ISN’T SOMETHING YOU CAN JUST GET OVERNIGHT USUALLY TAKES ABOUT A WEEK TO SHIP THAT PING PONG TABLE
 
3:03 PM
@SecondRikudo Maybe after the weekend ;)
 
Lester is spamming the mailing list again :(
 
@DanLugg Then type 'bork'
 
@SecondRikudo :-P
Aww! Someone "fixed" it! Before it was cumulative, so if you kept typing "bork" it would get really borky.
 
@NikiC Lester is always spamming the mailing list.
Fuck, I accidentally sent my bug report... Oh well, they'll probably figure out something's up when the broken tests have "bigint" in the name :p
 
@AndreaFaulds I think you meant 'Oops'
 
3:08 PM
Sorry, I'll swear less. I can't edit that now, though.
The world will forever know that I used profanities too much!
 
user895378
@Fabien Okay, so the only way to get at the final URI when following redirects is convoluted and hard to use right now. So what I'm going to do is add a new "header" to responses that are redirected to store this information. So that you can do the following with the completed response:
 
user895378
if ($response->hasHeader('X-Artax-Redirect-URI')) {
    // This was the result of a redirect
    $finalUri = $response->getHeader('X-Artax-Redirect-URI')[0];
}
 
Cool thanks.
 
@rdlowrey I don't like the sounds of that. Add metadata, not a fake header?
 
I take it that'd be in dev version for a bit?
 
user895378
3:12 PM
@AndreaFaulds Where do I add the meta data if not the headers?
 
user895378
This is a pretty standard way of doing this sort of thing across HTTP applications.
 
It shouldn't be. It's a client, don't lie about what headers you got.
 
@LeviMorrison Awesome work on the RFC, however ReflectionType is really itching me. Did you kibosh ReflectionTypeHint?
 
user895378
@AndreaFaulds So X-Sendfile shouldn't work in webservers then, I take it?
 
@rdlowrey No, that's different. That's a direction to the webserver, in a case where there are few other good communication channels
Here, you could add it as a property to the object.
 
user895378
3:15 PM
@AndreaFaulds No, you're setting a header which the webserver is treating like a variable or a function call. It's the same thing but on the server end.
 
ReflectionTypeHint, ReflectionTypeAnnotation, ReflectionTypeConstraint seem a bit less ambiguous (because ReflectionType seems like it's the rightful name of ReflectionClass, as ReflectionClass is kind of a misnomer with it's applicability to interfaces)
 
Not at all, it's a real header with real meaning.
 
user895378
@AndreaFaulds I'm not crazy about adding a Response::getMeta() to an HTTP representation, though.
 
user895378
@AndreaFaulds Disagree. It has zero meaning for HTTP.
 
The webserver will strip the header later.
 
user895378
3:16 PM
Which means it wasn't a real header.
 
user895378
It was an application directive telling the server to do something.
 
No, it was a real header. One the webserver used.
 
user895378
If it were a real header it would be sent to the client.
 
user895378
In any case, I see your point (it's valid) and I may come up with some other way to represent the meta data. X-Sendfile is neither here nor there and not worth debating :)
 
It's just, well. In that case it's the best way to do it
Here, it's a workaround where there are plenty of better options IMO
Especially since you could have an array which has the redirect chain, if it's a chain, for instance.
 
user895378
3:18 PM
@AndreaFaulds Yeah I was just hesitant to add something unrelated to HTTP to my Response class (not crazy about Response::getMeta())
 
user895378
@Fabien It will be either tonight or tomorrow before I can hack something together and push to the master branch. Once it's done I'll ping you with usage instructions.
 
@rdlowrey Actually... instead of getMeta, how about getActualURL() or something like it?
 
@rdlowrey Awesome thanks :)
 
user895378
@AndreaFaulds I suppose I could use getUri() in Response ... Request::getUri() already exists for obvious reasons.
 
Yeah, that'd work.
 
user895378
3:20 PM
@Fabien I'll do that instead ... there will just be a new Response::getUri() method that returns the final URI retrieved regardless of whether or not there were any redirects.
 
Furry muff
 
@rdlowrey Hmm...alternatively does Artax create a new Request object internally when it follows a redirect? If so, just $response->getRequest()->getUri() ?
 
Hey guys, I know how to measure time in PHP
but the problem is, how do you deal with the fact that the CPU is also busy with other things working on your OS
so it could never be optimistic
 
you can't deal with it, it's why you do many iterations
 
yeah I have to test with at least 1000 records of data to see some more substantial results
 
user895378
3:24 PM
@Danack I hadn't considered associating the Request object with the Response object like that. That would actually probably be really helpful for other things as well.
 
user895378
That is probably a better solution.
 
Yeah...particularly when you get an error response and want to log what the request that caused the error was.
 
Ooh, that's a good idea.
 
user895378
Currently the same request object is just modified on a redirect. You could just check $request->getUri() yourself, but that's problematic if you do this:
 
user895378
$client->request('http://www.google.com');
 
user895378
3:26 PM
because then you don't have a reference to the request object.
 
I've implemented an HTTP client before and handled redirects by running the destructor and then constructor sequentially to "restart" the request... which isn't the nicest thing. That's a lovely, clean solution.
 
user895378
So that's what we'll do. Good job @Danack
 
user895378
$response->getRequest()->getUri();
 
@NikiC Ulfs reply made me smile :)
 
@rdlowrey I suggest public function getRequests(): array instead
That way you can handle redirect chains nicely
If you just want the first/last one, they're easy to get.
 
user895378
3:28 PM
@AndreaFaulds Sold.
 
user895378
Response::getRequests() with full redirect history
 
how can you get multiple requests for a single response?
that doesn't make http-sense
 
@rdlowrey whereby [0] is the most recent, [1] the one before [0] etc?
 
getRequestHistory() for example would be better imho
 
3:30 PM
Sad times when you look in your mug and realise you forgot to drink your coffee and it's now cold :( #firstworldproblems
 
user895378
@Ja͢ck yup.
 
@FlorianMargaine redirects and 100 continues..
 
user895378
^ that.
 
@Danack you still have a single response for a single request every time
 
3:31 PM
Fighting the urge to respond to the list with "Boom, headshot"
 
user895378
Not with 100 Continue.
 
user895378
You get two "responses" for one request in that case :)
 
@FlorianMargaine Not at the application level - artax does the following/resending for you.
 
@DaveRandom There's a few people who can get away with stuff like that, Ulf is one of them :p
 
Because fark having to code that in an app.
 
3:32 PM
@rdlowrey heh
 
user895378
@DaveRandom M-M-M-M-M-MONSTER KILL!!!!!
 
@Danack hmm
 
@Danack Still want access to redirect responses though...
 
@rdlowrey Unrelated (maybe) to artax, but I thought some of the methods for interaction on Goutte were cool.
 
3:32 PM
(for e.g. cookies)
 
@Leigh who's Ulf?
I mean, I've seen his mail
but who is he, generally speaking?
 
user895378
@Fabien At some point I will write a scraper that's 1000x better than Goutte, but I just haven't had time.
 
@FlorianMargaine From memory, the author of mysql / oracle extensions?
probably more
 
@rdlowrey Don't play with my heart.
 
user895378
@Fabien By 1000x better I mean 1000x faster. The API is actually pretty nice. But it uses Guzzle under the hood. I could write one that was massively concurrent that could accomplish the same task in minutes that would take Goutte hours.
 
:'(
 
@ircmaxell Have/are you going to submit to phpconference.com.au ?
 
My entire work life is scraping these days. Scraping and regex matching.
 
@Fabien Gotta build up that porn collection somehow.
 
3:36 PM
lol. To rival @PeeHaa's one day.
 
user895378
@Danack Yep. You really need a bot to navigate all the popups and trap ads.
 
hi guys i have a doubt! can somebody help me?
I have a form with some textboxes. i wanna save the text of all my textboxes but i dont know how to do it...
i tried:
$varEmp = myForm.MyTextbox.text, but it doesnt work... any idea??
i dont wanna send my form to other form
 
@rdlowrey doesn't guzzle support nbio now ?
 
@Jean Is that meant to be Javascript or PHP? either way you should probably be just googling for a basic tutorial that does what you want to do.
 
@Jean I am not sure I follow the code. is it javascript?
 
3:41 PM
it's php
 
no do not think so @Jean, where do you have that code from?
 
user895378
@JoeWatkins "supports" is very loosely used there. Something that currently uses guzzle would still need to rewrite the entire application to actually take advantage of that.
 
user895378
Because as you know concurrency != parallelism
 
i have:
function actualizarPerfil()
{
require('conexion.php');
$con=conexion();

$nomempresa= f1.empresa.gettext();
}
?>
 
user895378
If your application isn't written for non-blocking the nbio doesn't help you.
 
3:42 PM
it's on a .php file
i just wanna save my text, to use it later, but i dont wanna sent it to other php file
 
@rdlowrey you said "concurrent" ... clarify, do you mean if it used parallelism it could be 1000 times faster ?
 
user895378
@JoeWatkins Yes. Because I have tools that do both.
 
> Have you been using PHP 3.0 professionally?
 
Not recently...
 
user895378
Also, Guzzle's new async functionality is a pretty direct ripoff of mine (annoying).
 
user895378
3:45 PM
Also, I don't actually believe curl_multi() is capable of real non-blocking without polling, so I'm quite skeptical of mtdowling's claims on that front.
 
Not in PHP userland, anyway
libcurl might be capable of doing it
(never looked)
 
user895378
libcurl is.
 
user895378
But ext/curl is not.
 
Maybe get a 1.0 release done and people can start legitimately advocating moving from guzzle to not guzzle.
 
curl_multi_exec is a libcurl api ...
 
user895378
3:47 PM
guzzle can do non-blocking only in the context of curl. It's not actually usable in a non-blocking application.
 
user895378
I can't use combinators to perform a guzzle request and some other non-blocking thing concurrently.
 
user895378
(re: mtdowling doesn't understand what non-blocking actually is)
 
any idea guys?
 
user895378
@JoeWatkins In no way related though.
 
user895378
curl_multi_select()
 
user895378
3:48 PM
You can only select on curl resources.
 
user895378
not other non-blocking resources.
 
user895378
in libcurl you can actually select() (or use event libs like libuv or libevent) for this. In userland ext/curl you can only select specific curl_multi_init handles
 
user895378
Anyway, real life is infringing on my programming time today. Will be away from the desk for the next several hours but am planning on spending a sexy friday night writing code after that :)
 
user895378
Hope everyone has a happy Rebeccaday!
 
o i c
@AndreaFaulds @krakjoe @ircmaxell Anonymous classes could be a good route to generics? I haven't looked at any RFC/Implementation in detail.
does anyone have a single clue what that means ?
 
3:59 PM
Not sure.
 
@Fabien :D
Which reminds me I still need to create that porn site
 
but they have generics in hhvm right?
 
hack does yeah
I really have no idea what she's trying to say there, she obviously knows something I don't ...
> Lucky for us at the time nobody gave a hoot about PHP and so nobody bothered to tell Taylor that Laravel was stupid and pointless duplication.
don't remember when that was ...
 
posted on October 17, 2014 by kbironneau

/* by JRich */

 
@rdlowrey Actually @DaveRandom was probably right...there may be times when people need access to the intermediary responses. If that was possible to do through $response->getPrevious() then you wouldn't need to have the ability to get all requests from one response, you could step through the responses and get the individual request per response. Linking the responses together might be tricky though.
 
4:07 PM
^ that
An array is not required, it's a chain of things like e.g. exceptions
 
@JoeWatkins "Lucky for us at the time nobody gave a hoot about PHP" translation "At the time it was cool to mock PHP, so we made fun of it, but now Laravel is cool so I'm going to fanboy about that"
 
With the first request/response pair returning NULL for a call to getPrevious()
 
@Danack seems about right ...
the only time you really hear someone say anything about duplication is when someone posts yet-another-router on reddit ...
we don't need more routers ... setting up as a package vendor seems quite smart, nobody is complaining about that, or they are, but not in the same way as when FabulousRouter is posted on reddit ...
 
> [...] hugely popular PHP framework that would be a big part of the revitalization of PHP you would call be bat shit crazy
^^ I'd still call him bat shit crazy.
 
@DanLugg As in, the name is really bothering you?
 
4:18 PM
@LeviMorrison Yea, basically because I've always thought ReflectionClass is a misnomer; too narrow a description when it applies to interfaces.
 
@DanLugg 'ClassInterfaceThingey'
 
I know we can't retrofit that thinking, but usurping ReflectionType is a bit ambiguous.
 
I'm not personally going to change to hint
if we do declaration or something else... maybe
 
Constraint?
 
But not hint.
 
4:19 PM
Okay, that's fine.
 
They have never, in their entire existence, been hints.
I'm not going to perpetuate that misnomer.
 
Also fine, as that is also a misnomer. ReflectionTypeConstraint would be more accurate, though perhaps a bit weird.
And it remains general to the use for parameters and returns.
I know we'll never have ReflectionType aliased to ReflectionClass, and I also know this is just tangential subjective barking on my behalf, but it really does irk me.
 
Naming it anything other than ReflectionType precludes usage with generics
 
@NikiC How so?
 
Also, given how "array" is a type as well, I don't see why you'd want to reserve the term Type for class-like thingies only
 
4:23 PM
Well, I don't agree with much of PHP notion of types ;-)
While in the same vein, interfaces aren't "class-like"
Anyway, </concern-rant>; I just thought ReflectionType could be elaborated; seems that *Constraint works reasonably well IMO.
 
@NikiC By chance do you know who designed a lot of the PHP 5 object model?
 
@LeviMorrison nope
 
Figured as much; was hoping I was wrong.
 
A: So, ReflectionClass reflects classes?
B: Yes, and interfaces.
A: Oh, are interfaces abstract classes?
B: No, they're a separate construct.
A: So they can be generalized as "types"?.
B: Yes, along with array, callable, etc.
A: So the Array class--
B: There is no array class.
A: But you said array was a type.
B: I did indeed.
A: Fuck you.
 
@DanLugg Looks like somebody never used C or Java ^^
 
4:30 PM
@NikiC :-P
 
A: Is the variable a float or a Float?
 
B: It doesn't matter, variables don't have types.
 
what language are you talking about here?
 
@Leigh See the room title.
 
ok, because... variables have types..
 
4:31 PM
@Leigh values have types ;)
 
^^
 
variables contain values that have types ^^
 
bah, semantics
 
B: Also, it doesn't matter the type of the variable because at the end of the day you can add 1 and "foo", and PHP will say "OH I C U R TRYING TO DO MATH, PLZ ALLOW ME TO DEMONSTRATE"
 
4:36 PM
@NikiC I favor systems designed with sweeping generalizations in mind; like that all data has a type, and the definition of type is comprehensive to all usages.
 
@DanLugg Everything has a type - in some languages there just are different kinds of types
 
@NikiC Right, "definition of type is comprehensive to all usages" is where that breaks down.
I just find it easier to rationalize systems where you can say "everything is ..." without "...except"
Everything is an object! Everything has a type (and there is one representation of type)!
 
user1642018
hi all
 
@NikiC and in PHP everything is a hash map ^^
 
user1642018
a quick question , are there ay other characters other than + which gets converted to space or any other form ?
 
4:47 PM
@AMB get converted when?
 
user1642018
i meant if i have + in url get var it gets replaced by space.
 
Percent-encoding, also known as URL encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI) under certain circumstances. Although it is known as URL encoding it is, in fact, used more generally within the main Uniform Resource Identifier (URI) set, which includes both Uniform Resource Locator (URL) and Uniform Resource Name (URN). As such, it is also used in the preparation of data of the application/x-www-form-urlencoded media type, as is often used in the submission of HTML form data in HTTP requests. == Percent-encoding in a URI == === Types of URI ch...
this?
 
user1642018
nope. i dont know whats it called ,
 
user1642018
9
Q: PHP - Plus sign with GET query

userI have a PHP script that does basic encryption of a string through the method below: <?php $key = 'secretkey'; $string = $_GET['str']; if ($_GET['method'] == "decrypt") { $output = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))),...

 
user1642018
4:51 PM
what i am doing is , checking the slug from title with the one in the db and if not equal then redirect to page having proper slug, just like so doing it.
 
@AMB yes
 
user1642018
my make slug function is like this /.
 
Although they are a combination of characters
 
user1642018
//make slug from title for url
function make_slug($title){

$bad = array('?','!',' ','&','*','$','#','@','/');
$good = array('','','-','','','','','','');

$title = strtolower(str_replace($bad,$good,$title));
$title = str_replace(array('----------','---------','--------','-------','------','-----','----','---','--'),'-',$title);
return $title;
}
 
@AMB go go gadget regex...
 
4:52 PM
@PeeHaa the regex for that would be character soup
 
Which beats quote and comma soup
 
user1642018
so if url contains + then it becomes "space" and the condition becomes false always and it goes in infinite 301 loop
 
@AMB You should not have + signs in urls if you don't want spaces?
 
@AMB you need return urlencode($title);
 
user1642018
yes, thats what i am asking are there more characters / symbols which gets converted to space or any other than original value if used in $_GET[] ?
 
4:54 PM
%20
 
user1642018
okie.,
 
yes, read wiki page that was linked before
 
user1642018
sure.,
 
user1642018
thanks.
 
user895378
@Danack I agree. I used to do this in an older version of the code. I originally removed it because I thought it would be a LoD violation to do that. But now I realize that getPrevious() is equivalent to retrieving a property (like $previous = $response->previous) so there's no problem with LoD. (sorry for multiping)
 
user895378
4:58 PM
I will add Response::getRequest() and Response::getPrevious()
 
Awesome.
 
is there anyway to automatically insert ' ' for every field that does not accept a null value in a sql query?
 
@ircmaxell Were you involved in PHP internals back when 5.0 was created?
 
@DemCodeLines Yes. Make ' ' the default value
 

« first day (1462 days earlier)      last day (3501 days later) »