« first day (1840 days earlier)      last day (3124 days later) » 

9:00 AM
Well, 20:7. 20:13608 would be a tad drastic
 
There's not much to break actually. It does work, but it simply ignores round braces as I said.
 
If you're getting nowhere, echo out some messages like 'at the top of the loop -> a=$a, b=$b, c=$c'.
 
I already did that. Everything is as expected in that regard.
 
Honestly @ЗахарJoe it doesn't ignore those parentheses.
 
@rtheunissen If you have the time, I dare you try it yourself to see? I can paste the whole script in here for you to witness that yourself.
 
9:02 AM
'...' (T_KRAKJOE)
 
Any one please help, how to find given any remote video link have video in php
 
That's not a PHP problem, it's an HTML problem
 
Anonymous
> given any remote
 
Anonymous
??
 
9:07 AM
1
Q: whats the difference in parentheses in IF statements?

MontyI've noticed in my dealings with PHP & javascript, still learning btw, that the following seems to produce the same results. if( ( $A==0 ) && ( $B==0 ) ){} if( $A==0 && $B==0 ){} What is the proper term for this in programming so I can learn more about it.

 
@ЗахарJoe 3v4l.org/7Yuf9
 
@JoeWatkins O_o
 
Anonymous
@AnanthaselvamP what?
 
@samayo That is an example link.
 
9:09 AM
MooOOOrninings
 
@JoeWatkins Yikes! Does it really have to be THAT big?!
 
@samayo just we find given url have video or not
 
morning
 
@ЗахарJoe doesn't have to be anything, that's just how I'd do it ... probably ...
 
FRIDAY!
(Morning)
 
9:11 AM
@Sean You mean FRIDAY ?
 
@Naruto Ptchh, no. I mean it's annual PHP6 Appreciation Day
 
Still, you're using switch/case logic there.
 
@samayo Are you there. please help
 
@Sean I don't click links on friday :D
 
That does look useful, especially for bigger projects.
My sin is that I misused PHP. I probably should've used Perl, Lex or Scala, but it'll take time to learn them.
 
9:29 AM
that's a little better ...
 
Thanks @JoeWatkins I'll try to repurpose it to handle other types of sentences.
 
yeah that was the idea ...
 
I am setting up a dev env with vagrant.. usally I just have a ugly provision.sh script.. but today I wanna try something new (frydai and all) .. do any of use chef and can recommend it... or is there another provision tool I should look at?
Happy frydaaai btw
 
All right, I'm going to study the code. The whole notion of constructs is somewhat new to me, need to dig deeper.
 
..is it a thing to use \StdClass;?
or just new \StdClass();
or I guess (object)
 
9:39 AM
@Ocramius peek
@Sean it's probably $object = (object) []; but with new StdClass works as well.
 
@Sean it's not new, but some people use conversion from array instead
 
@RonniSkansing you could try Ansible. I find it easier as it is self documenting. Take a look at phansible.com
 
I heard about Ansible, but have not looked into it... I will try and research abit thanks @Adoni
 
`$a = ["hello" => "world"]; $b = &$a["hello"]; $c = $b; $b = "foo"; var_dump($a); $c = "bar"; var_dump($a); `
$b is able to change $a["hello"], but $c isn't.
Got the answer here
 
10:06 AM
When unit testing does it make sense to have a test with a mock to verify that a method of the mock is being called with the correct parameters so that then in other test when you stub that dependency you don't need to specify what arguments it's called with before it returns something because you already have a test which verifies it gets called with the correct parameters? It would mean less refactoring if the signature of the method changes.
 
That is one of the longest sentences I've ever read
 
Anonymous
@AnanthaselvamP I don't understand your question, so I can't help you
 
10:23 AM
@Jimbo Thank you
@Jimbo Now what is you opinion on the matter please
 
Anonymous
@AnanthaselvamP so before you include and show video stream in your website, you want to make sure if the video works?
 
10:40 AM
@samayo yes correct
 
It seems awefully quiet around here for a friday :P Where did everyone go?
 
Anonymous
@AnanthaselvamP If you are using a youtube video, you should check its API.
 
Anonymous
It shouldn't be a problem
 
U mean youtube-api ?
 
@samayo not only youtube url. we use any remote page url (example: personal site video link also)
@Naruto no. i dont get problem in youtube url check validation
 
Anonymous
@AnanthaselvamP for any page url, it is not easy
 
@samayo where i can get help.i am struggling with this
@samayo please help.
 
@AnanthaselvamP show us what have you tried ?
 
Anonymous
I can't help you. You can not check every video type or video player out there to give you accurate information they way you want it @AnanthaselvamP
 
http://stackoverflow.com/questions/33420762/how-to-find-that-a-given‌​-link-provides-video-source-either-direct-stream-or-from
 
Anonymous
10:51 AM
Just rethink your idea
 
@NullPoiиteя Before I include and show videos in my website, I want to make sure whether the url is a valid source of video link.
@samayo this is not my idea.this is my client idea.what i do?
 
@anantha you will never know if its a valid video source, i.e the video url may work but the video may just be a advert
@anantha or may just be a blank video
 
Anonymous
@AnanthaselvamP surely, it won't be done in PHP. Use a combination of Javascript and HTML5.
 
Anonymous
Anyway, there isn't much I can tell you more
 
@anantha but you could do this with curl extract the html of the page, look for the url and then check if headers are givin 404 or not
on the url extracted
 
10:58 AM
@AnanthaselvamP just make a request and see if you are getting valid response
 
@NullPoiиteя is that not what i just said ^^
 
Actually i used curl option. but its not checking the video exist or not
 
you can use headers to see if it does
$file = 'http://www.domain.com/somevideolink';
$file_headers = @get_headers($file);
if($file_headers[0] == 'HTTP/1.1 404 Not Found') {
$exists = false;
}
else {
$exists = true;
}
 
@iCeptic ohh ;) i didnt even have look at other message :(
 
@NullPoiиteя its ok ill let you off this time :P
 
11:01 AM
@iCeptic i accept it.i am also use header but i dont get the result ... since youtube.com and google.com reply the response same 200.
 
ahh your using youtube
ok
tried the curl method?
function url_exists($url) {
if (!$fp = curl_init($url)) return false;
return true;
}
 
Morning friends of 11
 
this doesnt realy on the http header response mehtod
 
@iCeptic i am use this curl program.
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_URL,$url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($handle, CURLOPT_FOLLOWLOCATION , FALSE);

curl_setopt($handle, CURLOPT_NOBODY, TRUE);
curl_setopt($handle, CURLOPT_FAILONERROR, TRUE);

$response = curl_exec($handle);

$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);



if (!filter_var($url, FILTER_VALIDATE_URL) === false && $httpCode !== "404") {
return true;
} else {
retrun false;
}
 
11:04 AM
@PeeHaa morning!
 
@PeeHaa morning
@PeeHaa happy Halloween o/
 
@NullPoiиteя isn't that tomorrow?
 
@Naruto isnt halloween tomorrow?
 
@bwoebi time zone difference, i played safe game and tell him in advance :), happy Halloween to you too :)
 
@AnanthaselvamP
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_URL,$url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($handle, CURLOPT_FOLLOWLOCATION , FALSE);

curl_setopt($handle, CURLOPT_NOBODY, TRUE);
curl_setopt($handle, CURLOPT_FAILONERROR, TRUE);

$response = curl_exec($handle);

$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);


function url_exists($url) {
if (!$fp = curl_init($url)) return false;
return true;
}
 
11:07 AM
@NullPoiиteя bah, +13 and +14… that's too exotic ^^
 
hi guys, anybody can show me link, where I can see why this code sample fail
class A{

}
class Test{
public function test(A $a){

}
}
new Test();
exit;
 
unfortunatly i cant test on youtube as my work blocks youtube fb etc :( but should work
 
create your own vpn, shortcut would be create page with iframe and open url using it
 
@iCeptic I have no idea, halloween isn't a bug custom where I live.. But then again, I'm not the one that said happy halloween :D
 
@Naruto neither you were haha! my bad miss read
@Nul
*@NullPoiиteя i would but everything is tracked here
 
11:11 AM
change the job then!
 
@NullPoiиteя every website i visit gets put into a report and gets fed back monthly
@NullPoiиteя i would but it pays to good :(
 
in my company i can watch youtube, open fb and play games too
 
@NullPoiиteя let me work beside you?
@NullPoiиteя for the same wage im on :D
@NullPoiиteя i will never get another job which pays the same as this for what i do lol
 
i make more money working part-time from home than job.. but people here are awesome
 
11:13 AM
@NullPoiиteя people here are awsome :D
 
@iCeptic i will check that code...once i done.let you know
 
@AlmaDo that is racist why always white guy have fun :P
 
@AnanthaselvamP if it doesnt work there is another way which could work :)
 
@NullPoiиteя ;)
 
@iCeptic please share that too
 
11:17 AM
@AnanthaselvamP i will do :) im just thinking you could single out youtube requsts and use the api for it
and use curl for the rest of the requests
 
For an XML API, would you use a builder pattern to create requests?
 
@iCeptic the above curl code not working.its accept every url
 
even on stuff that doesnt exsist?
 
@iCeptic its only check 404 errors only
 
@AnanthaselvamP what else you want to check?
 
11:22 AM
@AnanthaselvamP yeah.. thats what you wanted? to check if its dead or not?
@AnanthaselvamP so run it past me again what do you want it to do :P i forgot lol
@AnanthaselvamP check for video, if link exsists store link if link doesnt exsist then dont store link?
 
@NullPoiиteя Before I include and show videos in my website, I want to make sure whether the url is a valid source of video link.
@iCeptic yes check for video
 
@AnanthaselvamP essentiallty that was the above does ^^ if it dont exsist you get a 404 :)
 
hey
 
i want check whether the given url response with a video source not a blog url
 
One more time, why it is not work?
class A{ }
class Test{
public function test(A $a){ }
}
new Test();
 
11:28 AM
@AnanthaselvamP just to clairfy you want to extract a url(of a video) from a blog then verify if the video exsists?
@AnanthaselvamP is it specific websites? or random?
 
@AnanthaselvamP please do some r&d its really not a difficult task
 
random website and also video sharing website (like youtube,vimeo, etc)
 
I'm confused about PSR-4 and composer. Sub-namespaces' name must match the dir name else the Sub-namespace has to be autoloaded as well.
^^ correct?
 
@degr new Test(new A()); or public function test(A $a = null)
 
@AnanthaselvamP afait what all you need to know now lmgtfy.com/?q=how+to+google
 
11:33 AM
@NullPoiиteя. if you give normal blog url its also provide valid link. i want check only video
 
@AnanthaselvamP this would be hard as not every website follows the same structure for how videos are displayed (not everyone uses the video tag) but you could use preg matches on the html gatherd via curl to try and find the video url
 
@Rommy public function test
@Rommy oh.. What?
 
@iCeptic he just keep asking code, you are now wasting your time :) (just wanted to warn you from vampire)
 
Test class did not require any objects inside of constructor, and I do not invoke method test
 
@NullPoiиteя haha thanks :)
 
11:35 AM
@NullPoiиteя i want idea only
 
@AnanthaselvamP i gave you the idea ^^
 
@NullPoiиteя not code
 
@degr sorry misread, so what isn't working?
 
lol, this code
 
@AnanthaselvamP
grab the page's html via curl, search the page for the video tag/preg match to find a video url
use curl to check if the video url exists (by the curl code i gave you) if this exists then you can do what you need to with it else flag a warning?
 
11:37 AM
@iCeptic thanks for that idea that is valuable one for me. but its not working on video link validation
 
@AnanthaselvamP you could go one step furhter and uses mimes to check if the content is video formatted
 
@Rommy I think php interpret 'test' method inside of 'Test' class with uncommon logic, and try to invoke this method by self, and pass no attributes in it, and it fail
 
@degr actually my second snippet is working
 
anyone any good with javascript? im hopeless
 
@degr yeah there's something going on in the background if you name your method 'test'
 
11:39 AM
or shall i join the javascript lounge lol
 
@degr don't know what tbh
 
@Rommy I want to find something about it, think there is must be some doc
 
http://pastebin.com/Sc8WCTcJ
how do i make this load async?
 
@iCeptic okay thanks for your ideas. This is your name"iCeptic". i never forgot your name in my life thanks very much
 
@AnanthaselvamP no problem at all :)
 
11:41 AM
@iCeptic thanks for your help :)
 
@AnanthaselvamP did you look at my link?
 
@salathe, thanks for the great help i am researching the essence concept. :) once its work i notify to you.
 
@degr definining an empty constructor makes it work
 
ah
this is an old constructor initiation
from php 4 compatibility
 
yeah just read that
it's looking for the method called test()
as no __construct() is defined
 
11:47 AM
I know, forgot about it
 
Oh, boy.
What would happen with this?:
namespace Foo;
use \Bar\Factory;
use Factory as FooFactory;
Assuming /Foo/Factory is a class.
Would FooFactory represent Foo\Factory or \Bar\Factory? (or would it just fail)
 
@Sean you'd get a fatal error because of the "Factory" name conflict.
 
if Foo\Factory is a class, you'll get a collision at the use \Bar\Factory declaration
also, try it
 
I thought so. After looking at it in order.
I would assume if Foo/Factory wasn't loaded then it would be equal to \Bar\Factory
But if it was loaded it would error out
Basically not ideal, haha.
 
correct
 
11:52 AM
@ircmaxell Thanks for the hand!
 
12:06 PM
@Sean screw you! :P
 
lol
 
@salathe ♥ Sorry! Thanks too! :P
Mr. Blind over here.
 
@Sean Sorry too late. I'll be in a grump all day now. :(
 
12:23 PM
creative people's
 
12:36 PM
\o
 
g'day everyone
 
hi, i create a user registration form where i want to send verification email after the user fill the form.
what type of information will be send with email??
is may be the password or some thing else because i want to restrict the user.
that after enter the information sent via mail can only the way to login??
 
12:56 PM
As I'm relatively new to php I'd lieke to ask, when I should start learning a framework and which one (I'd prefer Symfony2 or ZendFramework2). Or should I get at least x years of experience?
 
Abe
morning
 
@Abe morning o/
 
@sguetsch why do you want to learn a framework?
 
@sguetsch Get to know PHP first. Frameworks can be nice, but if you have to change jobs not knowing PHP core well can hurt you
 
@Machavity frameworks can be nice?? :P
 
o/ feels more like slap than hi five
 
@Naruto I'm in a generous mood ;)
 
seems like it :D
 
posted on October 30, 2015 by nlecointre

/* by marianoR */

 
1:02 PM
The only place where you should always use a framework is email (PHP's native implementation sucks)
 
@NullPoiиteя \o
 
o/
so we slapped each other :D
 
@Machavity you mean use phpmailer? ^^
 
@Naruto Or something similar that does it's own mailing (i.e. opens a socket). I use ZF2 for legacy reasons
 
mm, phpmailer just cuz lazyness and easy to implement :)
 
1:08 PM
If I were starting a new project I'd use it
 
@Andrea I think if we had an any type I'd be okay with going from some type to any, but just dropping it seems like it would mostly be a mistake.
I think we should probably add full variance first in any case, though. Or at least at the same time.
So parameter types are contravariant and return types are covariant.
 
@LeviMorrison yeah that's the problem
we don't have Hack's (or the PHP manual's, I suppose) mixed so we can't disambiguate between code that needs to allow everything and code that just lacks type hints
21:7! That's 3:1
 
Thank you all for your replies
 
Abe
@Andrea regardless of the result, don't you guys feel you are adding too much to php and too fast now? this void thing required more thinking in my opinion
though seems like @bwoebi retracted his vote for some reason
 
But i have another question: http://pastebin.com/SARqrJGe

I't a tranformation of an array (i hope oyu understand the pattern if you see it)
 
1:23 PM
@Machavity Well when don't you start refactoring friday now? :P and get phpmailer in there? ;)
 
@Naruto Time. Too much uses the other way atm. One of those slow season mucking out projects
 
@sguetsch
$temp = array()
$temp[] = array('first' => $valuehere),
$temp[] = array('second' =>$secondvaluehere),
$temp[] = array('third' =>$thirdvaluehere)

should result in

[first] => Array
(
[1] => Test
[2] => Sas
[3] => Max
}
[second] => Array
(
[1] => asdf
[2] => lololol
[3] => Muster
[4] => qwertz
)
[third] => Array
(
[1] => 3651b2085df7ca6183967b7b208de2d0
[2] => 2a329d06d2391b740a608ee2db653073
[3] => 068554c7ed55916c305a401ff8a69e31
[4] => ac32f600827910984f686ff3a7419a7c
)
 
@Machavity I know the feeling, one of those projects that's better off rewriting the whole thing than to try and 'make it better'
 
@Andrea If we ever add more generic types like any or mixed I hope we have a way to denote that they do or don't accept null.
 
omg. guys! it's friday!
 
1:35 PM
In some languages their any type excludes null.
I like that, because in PHP a lack of type would essentially mean any|null.
 
1:48 PM
how much wood would a wood chuck chuck if a wood could chuck chuck wood?
 
48 board feet for the average North American male wood chuck.
 
how do i calculate the circumferance, diamater and length of this wood chuck?
also how do i calculate its processing speed?
 
2:00 PM
anyone can suggest some tutorial/book on C? for someone familiar with other languages
 
@SergeyTelshevsky c.learncodethehardway.org/book probably
Haven't actually used it, but it seems appropriate.
 
looks like something I'm looking for..
 
yeah, I've seen that one, just thought some of the good people in this room can suggest something from their own experience
 
2:08 PM
22:7
 
@SergeyTelshevsky No matter what book you pick to learn, make sure you enable some standardized version of C, make it pedantic, and enable a lot of warnings. So, if you pick C99, then add these flags when compiling: -std=c99 -pedantic -Wall -Wextra. Works on gcc, clang, and icc compilers(and probably more).
 
@Abe Right. I'm not sure about correct or not. I leave the decision to people with stronger minds about this.
 
@FélixGagnon-Grenier it could be done but wouldn't work well with weak typing
 
Abe
@FélixGagnon-Grenier nope. overloading is bad and is especially bad in a language that isn't statically typed which php is
 
@FélixGagnon-Grenier Other than making fun of people who think that function overloading is either important (or even good), nope.
 
2:09 PM
and overloading can encourage poor API design
 
@LeviMorrison why would you want to exclude null specifically, but include everything else?
 
@FélixGagnon-Grenier Union types.
 
@LeviMorrison thanks, something else I should know? maybe some resources I should/should not use? Like w3schools :)
 
@Andrea Rasmus voted yes. I'm amazed
 
2:10 PM
@LeviMorrison good point, rejecting null seems to be the convention
 
was wondering, since php7 seems to take a turn towards stronger typing
 
(which is partly thanks to me, as I deliberately made sure weak type hints wouldn't accept null)
@Machavity Rasmus isn't like Stas
 
Union type: StringBuilder|string. Sure, you still have to check which type and do something different but it's close enough for many purposes.
 
people complain about Rasmus's laziness but he seems to generally be in tune with the community and he seems to really understand PHP
 
session suddenly stop working in ubuntu, what could be problem?
 
2:12 PM
@LeviMorrison /me applies pressure You really ought to put it under discussion sometime, even without a finalized patch
 
@NullPoiиteя you have a bug in your code. You should probably do some debugging!
 
@Andrea does he…? Looks at his phan source :-D
 
@Danack i am not even able to start session, and set session variable
 
@LeviMorrison I have kinda mixed feelings on union types really. They would encode some existing APIs' types well. But they let you do things that I think we should discourage. Don't overload, make a separate method. Use superclasses rather than ad-hoc lists of similar types. Don't return FALSE on error, use NULL. etc.
@bwoebi I mean that I think Rasmus has a good idea of what PHP is and isn't
 
@Andrea yeah, definitely :-)
 
2:14 PM
@Andrea Separate methods depending on types is often a stupid idea.
And I used that word specifically.
 
@LeviMorrison it's a pain in C# and C++
 
You definitely should not call iterator_map or array_map or $collection->map depending on type…
 
you have 16 different methods which do slightly different things, and it isn't even a complete enumeration of logical possibilities
 
@Andrea If you want to abuse it, you can switch on types already today… just not have a hint in the signature.
 
@LeviMorrison yeah, you should genericise it
incidentally overloading is often used where generics should be
 
2:16 PM
All union types do is really signature and eventual smart casting for weak types.
 
@NullPoiиteя you need to do some debugging to gather more information. It's not possible to derive from first principles why your program isn't working.
 
consider the case of C# where you have a byte, short, int, long, ushort, ... version
 
@Andrea not sure how you want to compare this to PHP?
 
@bwoebi it's a case against autoloading, and also a possible misuse of union types
yes we don't have that many number types but analogous situations arise
 
Well... I'd still like to understand why having two constructors in a class, one of which being able to adapt to a PDOStatement and the other to an array would be that bad?
 
2:19 PM
nullables I like because they're super-simple and encourage best practices
 
3 mins ago, by bwoebi
@Andrea If you want to abuse it, you can switch on types already today… just not have a hint in the signature.
 
@bwoebi which is why we don't need union types there
 
@Andrea so, how do I communicate concrete union types on a parameter then?
 
consider whether you need to in the first place
 
let's assume yes, it's the most comfortable and user-friendly solution possible
 
2:21 PM
I think most cases of union types can either be replaced with something cleaner, or the function design is poor
 
so, what now?
@Andrea An example I often like to bring forward is foo(array<int> | int $param)
Or, it'd allow more flexibility for the return type. In a return type you like to be concrete. What two classes (implementing the same interface obviously) can be returned? (Depending on context it may be relevant to caller.)
@Andrea also, simple cases like int|float where you'd like to not loose any precision (okay, we could have a combined number type here, but it's just an example)
 
@bwoebi it's cleaner and easier to only accept an array
 
Or something having the same API as a specific class (e.g. external lib), but not implementing an interface you want to hint against… You now can your_interface|external_class
@Andrea I don't find so. especially in cases where 99% of cases you have just one item and for some rare occasions more items.
(I realize the latter one is just a variation of protocols like @ircmaxell RFC'd long ago)
But apart from that it should be rare that you union classes. the only thing is about unionizing scalars mostly.
@Andrea or… imagine accepting int|GMP.
 
2:40 PM
array|(ArrayAccess & Countable & Traversable)
 
maybe im being daft by why would this not work?

if(empty($question)){
echo "error: question not set";
}else{
var_dump($question)
}

here is the var dump
string '' (length=0)

if i change to !empty i get bool true
so wtf :S?
 
@iCeptic Post a more complete example in 3v4l.org
 
@machavi my codes abit messy i apologise but ill post it there now
https://3v4l.org/2emfO

@machavi again i appoligise for messy code :) i will tidy it up once the issue of empty is resolved :D
also the var dump is this
string '' (length=0)

string '' (length=0)

string '0' (length=1)
surely empty evals on '' and 0? or am i being stupid :O
 
@Andrea imo a union type would be useful for a lot of the Imagick functions where they either accept a string that represents a color, or an ImagickPixel object, which is the poorly named class that implements colors.
Anyone know if there's a built-in function that behaves the same as file() but for a string input? i.e. I want to split a string into lines, but preserve the new lines.
including preserving \r\n as \r\n....
 
Abe
3:01 PM
emulate prepares: yay or nay? ...and y?
 
Semantically
What would you pick?
/Foo/BarFactory
/Foo/Bar/Factory
/Foo/Factory/Bar
/Foo/Factory/BarFactory
Looking to organize my factories haha
 
posted on October 30, 2015 by nlecointre

/* by thureos */

 
/foo/bar/factory (personally)
 
Abe
"is a" on namespaces gives me cancer :B should be "belongs to", so "\Foo\BarFactory" or "\Foo\Factories\BarFactory" if you prefer
 
@iCeptic Your problem is $question = isset($_POST['Question']); so it's always a boolean. just remove the empty()
 
3:07 PM
:p Fair enough!
 
@Abe If you need them, you've probably fucked something else up. e.g. using doctrine and it's doing 30 individual queries to get the data for a page. Even at just 1ms extra per query (for the extra to/from the sql server) that starts getting to be a big overhead real quick.
@Sean It depends on whether the class is going to be used external to the 'module'. If it is, then including factory in the name is required. If it isn't then it's not needed.
 
@AlmaDo bad label man. A better one would be "When I posted a flame to internals"
 
@machavi god dammit, i feel stupid now lol
 
Abe
i don't have a preference. i only know that mysql's prepares, predictably, behave differently from other dbms's
so i thought emulated ones would be better
 
3:13 PM
does php automatically encodes some characters when filling $_SERVER['QUERY_STRING'] ?
 
@Machavity i can see exactly what i done wrong, lines 43-48 is the issue i ment to update this but instead i put exactly the same code on lines 61-64 without the isset lol
@Machavity thanks for you help :) i feel so stupid now lol
 
@Rommy Why do you ask? aka what's your real question?
 
@Danack Consider the following QS '?param=§', printing $_SERVER['QUERY_STRING'] shows param=%C2%A7
 
Yes, I have now considered that.
 
@Danack So does PHP automatically encodes characters when filling the $_server ?
 
3:22 PM
@Rommy i dont think it does
 
@Rommy You've got the wrong end. It's the browse that does the encoding when it sends the request to the webserver, i.e. Apache.
<html>
<body>
<a href="localhost?param=§">test</a>
</body>
</html>
Open that in chrome and look at the uri that the request is sent to, in the network tab.
 
I'm using postman to test but I'm guessing it's the same then
 
So now what's your real question?
 
Got no more you just answered me! ty
 
Cool. I was expecting to be about Apache not decoding those things properly....which can be a thing.
 
3:29 PM
What, I'm so confused. Isn't Baz meant to resolve as Foo/Bar in:
namespace Foo;
use Bar as Baz;
I'm getting an unknown class: Bar error.
 
@Sean Use statements are absolute pathed.
 
@Danack Huh. Did not know that. Thanks!
 
@Sean No, Baz is meant to resolve to Bar.
That's my understanding anyway
 
Abe
means that \Bar will be available as the symbol "Baz" in your file,
also means that if you use the symbol "Bar" in that file, it will try to load \Foo\Bar, accordingly to the namespace you are in
 
3:45 PM
youtube.com/watch?v=1LW__eE7-BA Me trying to pick up better code practices and patterns.
I'll get there eventually folks, sorry for poking the beast :p
 
Abe
3:57 PM
@Sean good luck, eventually you will become like all of us
 

« first day (1840 days earlier)      last day (3124 days later) »