« first day (1815 days earlier)      last day (3130 days later) » 

11:01 AM
lol. Not me. And it was funny because normally talks that are too basic are worse.
 
should SCRIPT_NAME return the drive letter?
apache2.4 windows64 bit i get $_SERVER['SCRIPT_NAME'] // C:/index.php
even tho it's actually on C:/Users/me/Sites/subfolder/index.php
is this strange behaviour? :S
 
That's very weird
 
excellent feedback @Andrea
 
11:04 AM
i'm glad it's not just me
 
Make a simple test case and report it at bugs.php.net
I have a feeling I know why that's happening
@JoeWatkins mhm! It went great.
 
okay, will do
how come?
 
Hi All , How are you
 
well my test case is really just echo '$_SERVER[\'SCRIPT_NAME\'] // ' . "{$_SERVER['SCRIPT_NAME']}"
 
we are good
 
11:06 AM
:p
 
thanks !!!
:-)
 
howz u ?
 
@Andrea how come?
 
0
Q: Get the Facebook User ID from a random profile URL

Jim SmithThere are several solutions proposed, but as is stated here (http://stackoverflow.com/a/26839926/1893249 ) , it seems to be impossible. In the FB Graph API explorer( https://developers.facebook.com/tools/explorer ), "/v2.4/cnn" returns the following, which is promising, { "name": "CNN", "...

I am trying to create findmyfbid.com
but so many tries not getting success..
any body have solution here
 
11:10 AM
both winners then ... excellent :)
 
Anonymous
@Jimbo Is the talk even recorded? How long/much will it take to see the talks?
 
Jimbo won a little too much if you ask me. He won 3 books during the prize draws.
 
Man we traded books so it's a good thing I did :P
 
lol yes. But still.
 
@samayo Yeah it'll likely take a few months until publicised, well going off how long it took last time
 
11:13 AM
BTW those cards you got, do they have a manufacturers name on them?
 
Anonymous
Is shouldn't take that long. Just upload and put a price tag on it :/
 
hi
 
@samayo They have to be cut up, make sure there's nothing wrong, might need to change audio, colour stuff... basically they have to be professionally edited and that takes time. You've just done what people say when "adding a thumbs down button on Facebook is basically a copy / paste of some JS" when it isn't ;-)
Not looked Fabor but will have a look later
 
my server is showing current php-common package installed is 5.4.16 when executed this command-
#yum install php-common

Package matching php-common-5.4.16-36.el7_1.x86_64 already installed. Checking for update.

but phpinfo() is showing my php version as 5.4.44.
So whats wrong I have done?
 
Remove it all, install php 5.6.*
 
11:19 AM
5.6.* ?
I have install 5.4.*
can I remove php-common-5.4.16-36.el7_1.x86_64 and install php-common-5.4.44-36.el7_1.x86_64
?
 
Anonymous
don't rely on php-common just check php -v
 
@samayo yes its showing php 5.4.44
 
Anonymous
it's ok then
 
hey hey
 
actually i am getting an error Fatal error: Class 'DOMDocument' not found ,so how can i install php-xml for php 5.4.44
 
11:22 AM
imma BAK
 
@Fabor I apologise
But I told you I wasn't the werewolf!
 
Anonymous
@tereško how was it?
 
lol. I wasn't the werewolf once. I died every time on the first or second round.
 
@samayo I probably got through the screening
 
11:34 AM
Also, be careful what you say on this google-able chat room :P some prospective employers might not get the context :P
 
now that I think about it, seems like I spent a lot of time talking
 
@ThW thanks for your reply. But its still not installing... Please refer. justpaste.it/o4wr
 
Anonymous
that might actually be true
 
@Fabor Yeah, like when I applied for PNWPHP as a speaker and put something about the 'beer incident' from my first talk on there about "why they should choose me" - I think they don't quite get the English sense of humour sometimes
 
11:45 AM
heh. Yes.
 
@bwoebi You saw the two reasons I said in the email? Which of those don't you agree with or grok?
 
> In this case they are bad as they can't be passed as a callable.
^ this one can fix… / add support for
 
You're going to write an RFC for that?
 
Haven't thought about it yet… maybe one can make a call to __construct return a new object, always…
(and new is just sugar to actually call __construct)
 
So __construct is static then?
(it is not)
 
11:49 AM
@nikita2206 by magic only, yes.
 
@nikita2206 it is static. The magic about __construct is that $this is made available and returned.
 
If I was dictator, then object construction would look like:
class Foo {
    public static function fromString(string $str) {
        $instance = new(Foo::class);
        //Do the actual initialization here.
    }
}
 
But in general, I'd be in favor of having some callable syntax doing fn(...$args) => new aClass(...$args) ...
 
where new() just allocates the memory for the object, and inits it to null.
 
And in general I disagree that it's likely to need multiple Closure ctors in future @Danack
 
11:53 AM
@bwoebi Levi already wants the individual ones.
closure::fromFunction, closure::fromInstanceMethod...
 
god, no…
 
> There is nothing to discuss, it's a necessary BC break which needs to be done regardless of any discussions.
Wow.
 
My thoughts: "WTF who said that … oh that was me…"
 
Exactly, I won't discuss this here, because I don't think we can have a rational discussion about it. I will just point out that this is another case where you've made a decision and are now discounting everyone elses opinion.
 
@Danack This time I even admit that I do.
TBH I'm a bit annoyed that it even attired that much attention…
I discussed it with Nikita, did it… and yep, here we are.
 
12:04 PM
@Andrea Andrea, what was your idea?
i've just updated to php 5.6.14 and the 'bug' is still present
 
@Danack Usually I don't intend doing that consciously … But this time nah… inlining brings measurable perf benefits in the range of a few percent in code. It ends up to: definitely not worth it. Or well… Is there a reason (apart from it's a BC break!!!) why you really would need that in any sane code…
@Danack it even removes the inconsistency with regard to internal functions…
 
what was the link for chat's word-usage statistics?
 
@bwoebi you really seem to not understand how concerning BC breaks are
 
@FlorianMargaine every bug fix is a BC break, strictly seen…
 
@bwoebi now you're just playing stupid
 
12:14 PM
@FlorianMargaine no, I'm not. I'm really seeing this change as a strict bug fix.
 
Which BC break / bug fix?
 
http://git.php.net/?p=php-src.git;a=commitdiff;h=517b5536259ecf7697f353f4bfbafde857fc1f81
http://git.php.net/?p=php-src.git;a=commitdiff;h=881c50252066132f83e190325e344f532be19033
@kelunik ^
 
so, if anyone can help: bugs.php.net/bug.php?id=70642
 
@AaronHarding the script name as seen by PHP is normally setup by the config of your webserver. For whatever reason it is putting the full path in there.
 
in apache conf or php conf?
 
12:21 PM
I'm going to guess apache - I'm more of an nginx guy myself.
 
yeah, i'm running apache
 
@Danack it's usually either mod_php or php-fpm :P
 
@AaronHarding This might be related - php.net/manual/en/ini.core.php#ini.cgi.fix-pathinfo
But as I said, i don't apache.
 
paradox sale (some actually good discounts): store.steampowered.com/sale/paradox_2015
 
class A { private $a = "foobar"; }
function foo() { var_dump($this->a); }

$closure = (new ReflectionFunction("foo"))->getClosure();
$closure->call(new A);
So this doesn't work anymore and was now changed in a bugfix in RC? @bwoebi
 
12:26 PM
@Danack thanks, i'll look into it
 
@kelunik yep. If you need this use a real Closure.
@kelunik Also, that example is totally weird by itself… because, self won't work… you can use $this, but no self:
Fatal error: Cannot use "self" when no class scope is active in Command line code on line 1
 
self? There's no self.
 
... I just said that you can't use it. I haven't said this doesn't work.
 
oh god this issue is in more places
going to look into nginx..
 
> example is totally weird by itself… because, self won't work
 
12:32 PM
Also, when calling foo() directly, you get Fatal error: Uncaught Error: Using $this when not in object context in Command line code:1 … I'm wondering why we don't prohibit $this at compile-time here…
@kelunik I noted that it is weird that you can use $this but not self.
 
@AaronHarding Is this a WAMP stack of some sort?
 
no, i just built apache, installed php
 
Do me a favor then. Try the same thing under, say, Easy PHP. Just for kicks
 
i'm only having trouble with CI/fuel cms since it uses all these ways to get the url for all it's assets and things and i end up with <script src="C:/fuel/modules/fuel/assets/js/jquery/jquery.js?c=...
ah i would, but i'm just about to go for lunch
i'll message you when i'm back and i'll try it
 
12:35 PM
thanks for the link tho
 
@bwoebi Well, you can rebind $this, but not self, because it's compile time.
 
ah damn… merged into wrong branch…
 
GERD MERNERNG
 
12:52 PM
merge… push… oh… master -> master? Nah… :s
 
1:06 PM
@tereško how was it?
nvm I found it in the transcript
 
1:22 PM
:D
 
@tereško You're avoiding web agencies I presume?
 
I am currently not avoiding anything
 
That bad huh
 
1:37 PM
@tereško hired?
 
@tereško You deserve something better, or something better deserves you. Whichever way you wanna look at it.
 
@Sajad you usually don't get to know, whether you are hired, right after the interview
 
@tereško Is it considered rude to just ask "so do you think there's a good chance I'll fit in here?"
I'm always up for being upfront and honest... cultures differ though
 
@tereško ah, you are excited now!
 
@Jimbo it was implied that I will be getting the recommendation, but the first interview was conducted by a recruitment agency
@Sajad nope
 
1:40 PM
@tereško you don't know. you are exciting!
be sure
 
You are exciting teresko!
 
:-)
 
@bwoebi Because of closure rebinding…
 
@LeviMorrison why don't we then allow self:: too there? ;-)
 
1:46 PM
Pretty sure because someone screwed it up at some point.
 
lol ^^
We could say the same for $this…
"We allow $this in functions at compile-time because someone screwed up" …
 
No, I didn't allow $this with static closures and someone opened a bug report saying, "It's not a bug because I rebind $this later."
(This was a bug fix)
Remember?
 
@LeviMorrison static Closures aren't rebindable at all?!
"Cannot bind an instance to a static Closure"
 
Is there a way to make phpstorm not strike calls to methods that have @internal annotation?
 
Honestly, we shouldn't have static closures, we shouldn't allow closure rebinding because our scoping is just stupid. That's my whiny opinion of the day.
 
1:51 PM
:-D
 
Closures should be able to be rebound to other closures. Closures have scope – why can't you bind another closure to it?
 
user1648409
For the filter function, i found this: stackoverflow.com/a/32900391
 
user1648409
Hi. Short question about security: When dealing with XSS i read the OWASP cheat sheet and it says to filter (sanitize) + encode the input. So basically when programming my web application in php i should a) filter malicious stuff out of user input before i put it in the db and then b) user something like htmlspecialchars() when displaying it in the website. Is this correct?
 
posted on October 05, 2015 by nlecointre

/* by CthulhuEgg */

 
Hi everybody, I started programming with PHP, quite a ride has been. Do any of you have a link to official coding conventions like java has: oracle.com/technetwork/java/codeconvtoc-136057.html I want to start coding properly with php, so far I've been using mostly java code conventions which it seems is not quite the same.
 
2:07 PM
@Shiuyin yes
 
user1648409
@Sjon so on every "insert into table" stuff i just spam this filter function and on every <?=$input?> i spam htmlspecialchars() ?
 
 
@Shiuyin Pretty much
 
@FraK there are no official coding standards - the standard most people follow is php-fig.org/psr/psr-2
 
user1648409
2:08 PM
@Sjon thanks al ot
 
@Sjon zend 1 - ewwww.
 
@Danack PHPSC was confirmed btw, so if you're thinking of talking again :)
 
@Danack It's more than what's in the php-manual; which is nothing
 
@Fabor If it's the same place, I might not. Both of those rooms are freaking horrible for giving talks in.
 
@Danack How come?
I thought it was alright
 
2:10 PM
@Danack Univeristy lecture hall would probably be better.
but I dunno anything about those kinds of costs
 
1) The noise
2) too wide, not being able to see the audience is a bummer.
3) Not having a lectern at a decent height. This is partly my fault - I screwed up by practicing my talk being able to see my notes in front of me. I couldn't see the laptop as it was too low.
4) Not being able to point at the screen. For the curved room, the screes moves back away from the speaker. For the big room, the giant screen is giant.
5) Those fucking toilets.
 
@Sj
 
@Danack Ouch, I never thought of those... but I thought you did a great job regardless
And that heckler was just a jeb end
 
@Sjon, @Fabor,@danack thanks !!!
 
thanks. How did your talk go?
 
2:13 PM
Really good, great feedback, more happy it's over now though - it was basically a month's effort and worry lol
 
6) The round room was boiling by the time I gave my talk. 3b) The lectern had no where to place water. Mental note - always take a bottle.
And this one can be fixed - lapel mike > hand-held mike > fixed position microphone
Other than that it was great!!1!
 
hum? function($foo => $x * $y)
 
@marcio Rowan is proposing syntax after syntax…
 
I like the lambda syntax: lambda ( args ; uses ; expr )
$x = 5;
$f = lambda($y; $x; $x + $y);
$f(6); // 11
 
2:29 PM
why not fn($1 * $2) then
 
Well, whatever keyword.
 
I'm kidding, it's impossible to read
 
Wait, I just realized you had $1
 
@bwoebi yeah, I'm anxiously waiting for the next one. The keyspace of possible random char combinations is depleting.
 
I'm not going to, but if I was going to troll internals, I would suggest $($foo => $x * $y) and then allow other closures to be generated in the same way: $($object, 'methodName'), $('functionName')
 
2:31 PM
@marcio :-D
 
@Danack All those poor jQuery fanboys... they would be so confused.
 
@Danack you forgot that you could omit arguments at all, and use numbers instead assuming arguments are passed like in bash
 
$1 * $2
 
function div() { }
$('div'); // fuck web dev
 
$($1 + $autoCaptured)
that's fucking awesome
 
2:32 PM
E_JS_LIB
 
@nikita2206 So you're going to troll instead?
 
git.php.net/?p=php-src.git;a=blob;f=Zend/… @Andrea can you please explain to me what the issue is when we control an internal class' $this? AFAIK the only issue is the inverse… when a $this which isn't in the inheritance chain of an internal class is passed to it?
 
2:46 PM
(which is ensured anyway)
 
user4268046
How do you call a super __toString() method?
e.g.
ClassX has __toString(){return 'x';}
ClassY extends ClassX
ClassY has __toString(){return 'y';}

I have ClassY, is there a way to call the ClassX->__toString()?
 
why would you want to call it directly?
 
@TheMineBench parent::__toString();
 
@RonniSkansing because the subclass also has a tostring
 
2:58 PM
ah thx
and morning btw =]
 
@RonniSkansing 3v4l.org/pDZ36 /cc @TheMineBench
 
user4268046
 
good morning
 
@Sjon site is looking better then ever +100
o/ Orangepill
 
3:05 PM
\o
 
any reason array_walk doesn't throw a warning when it gets a Traversable rather than an array? or return false (it doesn't walk it either)? 3v4l.org/qV2lA
 
@PaulCrovella it walks the object properties, probably :(
 
correct.
 
@Sjon Just had the problem again, that Ctrl + Enter submits the original snippet instead of the modified one.
 
@PaulCrovella Z_PARAM_ARRAY_OR_OBJECT_HT_EX() ...
 
3:11 PM
ahh... lovely
 
3:27 PM
except for non-userland objects? 3v4l.org/UPItE
 
That function doesn't return an array tho php.net/manual/en/domdocument.getelementsbytagname.php. I don't think you can use array_walk to iterate an object
 
Morning
 
o/
 
@Machavity scroll up for the previous handful of messages... also 3v4l.org/BthnZ
 
3:36 PM
I have a question about MVC
I don't use any framework and I have my own MVC
so, I have a index.php file that all other pages passes from index.php
like these:
www.example.com
www.example.com/class/function/arg
Now the problem is, this URL does not pass from index.php
www.example.com/search.php?arg=anything
why?
 
that's not "MVC" .. what you have is basic URL routing
 
yes, I meant was URL rougting
so why argument URLs does not pass from index.php ?
 
because you did something wrong
 
but I did all my action according a sample
here is the my .htaccess file:
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA]

ErrorDocument 404 /error404.html
 
is there a "search.php" file ?
if there isn't one, then look at what is contained in var_dump($_GET);
 
3:46 PM
@tereško yes there is a search.php file
 
@Sajad then your .htaccess rule is not triggered
 
but I want search.php file runs using requier_once(search.php) in the index.php
not directly
@tereško do you know how should be my .htaccess?
 
cannot you just use www.example.com/search?arg=anything ?
or maybe www.example.com/search/anything ?
 
@tereško I want exactly this
 
12 mins ago, by Sajad
www.example.com/search.php?arg=anything
 
3:49 PM
ah you mean is "seach" instead of seach.php ?
wait check
 
RewriteCond %{REQUEST_FILENAME} !-f is an IF in the .htaccess file, which check if file exists
 
@tereško look at me ... I LOVE you!!!!
 
Hello
in a function like this , what are $a and $b ?? how are they defined ?
function my_sort($a,$b)
{
if ($a==$b) return 0;
   return ($a<$b)?-1:1;
}

$arr=array("a"=>4,"b"=>2,"c"=>8,d=>"6");
uasort($arr,"my_sort");
Thanks
 
ThW
@Joseph Have you read the manual page about the function?
 
yes i have , what are $a and $b ?
 
3:55 PM
@Joseph those are values that uasort() passes to the custom sorting function
also, you probably should use the new anonymous function syntax there
 
ok but on what basis ? are they strings , arrays , what ?
 
Slow sigh … I hope with github.com/php/php-src/commit/… I now finally really am done with Closure rebinding…
 
@Joseph they're elements of your array, whatever they happen to be
 
@tereško well, now I want to prevent of opening seach.php?arg=anything, is it possible? I want user be unable to open this:
www.example.com/seach.php?arg=anything
is it possible?
 
@Sajad yes, but not in any nice way
instead you should keep the included/required files outside the document root
 
4:00 PM
@Danack are you fine with github.com/php/php-src/commit/… ?
 
is www.example.com/search?arg=anything not better? Drop the .php...
 
@iroegbu yes it is better, but I want to deactivate running search.php
 
posted on October 05, 2015 by nlecointre

/* by Benjamin */

 
@tereško I can not understand the mean of this!
 
4:04 PM
/some/folder/
    /pubic
        index.php
        stylesheet.css
    /application
        document.php
        search.php
        secret.php
where index.php contains:
<?php
    require '../search.php';
 
verywell! I got it
tnx
@iroegbu tnx for this link, but actually I don't need to it ;-)
 
@iroegbu I don't think you actually have anything good regarding directory structure for php projects
 
teresko could you share link regarding dir structure
 
gonna make a picture .. 10min
 
is the zend file structure somewhere like it?
 
4:11 PM
one small confusion when we say document root what does it mean??
 
   html/example/
        .htaccess
         /public
            index.php
            /css
            /js
        /controllers
            SearchController.php
            ...
^^ that's what tutorial will give you
 
yeah is example folder is called document root
 
@iroegbu how come .htaccess is not in public dir?
 
if you do that... example/controllers will be ajar
and other dirs
 
4:17 PM
@AnmolRaghuvanshi here ya go
 
that's perfect dir structure
 
nope
but that's the baseline of what I use
 
it's better what i saw on internet
 
what is in your api dir?
 
same as in website
 
4:22 PM
@tereško dump question- what does document root means??
 
oh... also, I find it odd that all dir names are in lower case...
 
@AnmolRaghuvanshi it's the folder that is opened when you access http://example.com/
in my example, the document root is /project_name/src/public
 
kk thnks
 
you set it in webserver's configuration
@iroegbu similar structure. It's just an example where client also wanted an API for the mobile app
 
@tereško do you know what is the mean of this line?
RewriteCond %{REQUEST_FILENAME} !-d
 
4:25 PM
same domain model, two frontends
 
it is also a if statement ?
 
@Sajad "directory"
 
oh! This is very good... Thanks for sharing
 
hi, I know it is not the right place to ask this type of Question but if you know please help me.... i create a school project make a website where i put a page name About us I'm confused what content should i right I have four other members..
 
now i feel better want to ask that question from several days thnks sajad ;p
 
4:27 PM
@iroegbu I had to make a structure so that initially both frontends can be run from same server, but also have an ability to easily put www.foo.bar and api.foo.bar on separate servers
 
@tereško ok "directory" what? if file exist on the directory?
 
@Sajad what do you think the "f" means in RewriteCond %{REQUEST_FILENAME} !-f ?
 
file
 
and what does the rule condition mean?
 
if file exist
 
4:30 PM
actually "if file doesn't exist"
 
and what are thought's abt dir structure provided by some framework like CI
 
but my question is about !-d
 
so ..
4 mins ago, by Sajad
RewriteCond %{REQUEST_FILENAME} !-d
if "d" is for "directory"
 
I got it :-)
 
what does this rule mean?
 
4:30 PM
I got it
 
.. you need to approach problems this way
 
tnx
 
a large part of what developers do (in all programming languages) is: look for patters
if you have a problem and you see a pattern, then you KNOW that the problem follows some kind of rule
 
yeah ok
 
AssertionException disappeared somewhere between alpha1 and alpha2; anyone know if this is intentional, or an accident with engineexception?
 
4:45 PM
@bwoebi I see you're going to be at the roundtable tomorrow as well :)
 
@FredEmmott It was renamed AssertionError.
 
thanks :)
 
@FredEmmott Sorry that all our RFCs are already out of date three months after being implemented...
 
Can I add Alphabet to this range?
$min=0;
$max=9;
rand($min,$max);
 
not directly
 
4:51 PM
ah ok tnx
 
you can make an array or string containing all the symbols and then pick a random index
but please don't use simple rand() for cryptographicl purposes
 
@tereško yes it is a good idea
 
.. I think I need one beer and some snacks
 

« first day (1815 days earlier)      last day (3130 days later) »