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

5:00 PM
do we have free monthly magazines for php??
 
I have this url:
http://localhost/myweb/login?destination=localhost/myweb/search?s=islamic_sources&q=anything
now I want after login, user redirects to this url:
http://localhost/myweb/search?s=islamic_sources&q=anything
How can I get second URL form first URL ?
 
@AnmolRaghuvanshi not that I know. But you can probably torrent "PHP|Architect" magazine
@Sajad how did you get that URL in first place?
 
@AnmolRaghuvanshi honestly, those php|arch publication have been really disappointing when I last time tried to read them
 
5:15 PM
@tereško 1. user is not login. 2. user search in my website. 3. then user wants to login. 4. then for showing the current page after login, the url of login page is like this:
http://localhost/myweb/login?destination=localhost/myweb/search?s=islamic_sources&q=anything
 
kk.should i read and give a try??
 
hmm ... that's actually reasonable approach for "remembering login location"
 
@tereško yes exactly, I wantto remember login location
now my problem is with getting this parameter:
http://localhost/myweb/search?s=islamic_sources&q=anything
 
@Sajad you can just put in your destination.php file: <?php header('Location: ' . $_GET['destination']);`
 
$_GET['destination']; does not work
 
5:19 PM
heh
remember when I told you to use $_SERVER['REQUEST_URI'] for routing?
 
the problem is in the firs url is two question mark
@tereško yes
 
this situation was one of the reasons
 
yes unfortunately ..!
 
well ... change your RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA] to RewriteRule ^ index.php [L,QSA] and $_GET['rt'] to $_SERVER['REQUEST_URI'] and it should be working just fine
 
You need to call urlencode on the destination before putting it there. Or use a framework that supports url generation.
 
@tereško honestly I scare to retouch the routing system of my website. it is a nightmare for me
 
@Sajad lol
 
there is another solution ..
I can
 
@FredEmmott first "solution" doesn't make any difference and latter require a lot of additional effort
 
replace the question mark in the url with other sign
 
5:25 PM
@AnmolRaghuvanshi suggestion: stay away from any site that actually suggests w3schools
 
and then for using it, replace it with question mark again
 
@Sajad then you will be also making a script which populates $_GET
@ircmaxell actually, one also should avoid php resource which contain "academia" and "university" in the title
 
@tereško: if done when generating the first URL, it does; it gets you ?destination=http%3A%2F%2Flocalhost%2Fmyweb%2Fsearch%3Fs%3Dislamic_sources%26q%3‌​Danything - then you can just use $_GET['destination']
 
@ircmaxell yeah thnks :-)
 
@FredEmmott problem is not the URL. It's his htaccess that is rewriting it as index.php?rt=login?destination=http;//not..important..anymore
the two question marks are the cause
 
5:30 PM
@ircmaxell why all people in here are hate of w3schools? I like it. It has been help me over and over
@tereško as I said, does not work!
 
@tereško: my apache is rusty, but I thought that would only happen if you had [NE] in your rewrite rule flags :/
 
user895378
@Sajad the canonical resource on this question is w3fools.com
 
@rdlowrey heh !
 
Hi @Sajad
@Sajad how are you dadash :)
 
@tereško you are familiar with my question, please write an answer for me (if you have free time)
@Nabi hello, fine, how are you?!
 
5:40 PM
@Sajad you have more explaine about your problem
i did not understand
 
@NikiC I … am trying ;-) I hope I'll understand you well and @Sara doesn't speak too fast… else I might end up understanding barely anything she says^^
 
@Nabi My problem is a routing problem.
 
you have a url by $_GET['q']
but you've shown a htacces with redirecting $_GET['rt']
 
yes, two question mark in one url ...! how can I get the second parameter?
 
well .. I gave you a solution ... you found it to be scary
 
5:44 PM
@tereško I have tried your solution, but it does not work
 
have you tried url_encode/decode?
 
RewriteRule ^search?(.*)$ index.php?$1
you've to do something like this ?
 
@iroegbu no
@Nabi what?! actually I don't understand ..
 
@Sajad have you started studying english?
 
:-)
I think I never able to learn english very well.... (it should be noted @Nabi is a Iranian person)
 
5:48 PM
@Sajad your english is very better me
 
I disagree ...
@Nabi Also I think you should say: "your English skills is much better than me"
 
yes but so long :-D
 
:-)
 
wait... "your English is better than mine"
 
@iroegbu ah yes! correct
 
5:52 PM
what is important conveying implications
 
A correct grammar is also important
 
grammar after you could convey your implications
 
I had three years of English in school… Sometimes I wonder why some peoples English looks that bad to me…
 
i have not learned much in school :-D
 
I have a question, why all people should learn English?! why English is the base? why Persian is not?!
 
5:57 PM
what i know about english is often while search in internet
 
@Sajad historical reasons.
 
that's unfair
 
Life is unfair
 
@iroegbu not always, but yes sometimes
 
but what do you think?
 
5:58 PM
"Persian" is a language? I thought the language is "Arabic"
 
english is better or persian ?
 
@iroegbu yes it is, Arabic and Persian are two different languages
@Nabi English
 
persian is arabic letters and often words
 
@Nabi Please stop talking about Persian language!
 
i have to say english is much better also for PC
OK @Sajad
sorry all
i have to go ...
 
6:00 PM
@Sajad it is "the right of inventor". It the same reason why we all use Arabic numerals in math
 
see you later and goodbye
 
@Nabi have fun
@tereško do you use Arabic numerals in the math ?
 
I do .. and so do you
1 , 2, 3, 4, 5, 6, 7, 8, 9, 0
 
they are Arabic ?
:-)
 
yes
Arabic numerals or Hindu-Arabic or Indo-Arabic numerals, are the ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, based on the Hindu–Arabic numeral system. Arabic numerals are the most common symbolic representation of numbers in the world today. The first true zero was developed by ancient mathematicians in the Indian Subcontinent. Arabic numerals are used to represent this Hindu-Arabic numeral system, in which a sequence of digits such as "975" is read as a single number. This system was adopted by the Persian and Arab mathematicians in India, and passed on to the Arabs further west. There is so...
 
6:03 PM
ok
 
@Sajad, you don't need to remove your messages if they are proven false
Also, English isn't superior to your local language...
 
@iroegbu I removed the numbers because this room has not Arabic fonts. All numbers are the same
@tereško in my case, using urlencode() is useful?
 
I don't see how it will solve your problem
 
أستطيع أن اكتب غرامة العربية
 
@tereško me too
@iroegbu what is its mean?
 
@iroegbu this
 
as for languages: the situation that we have is English emerging as the type 1 because it has become the unofficial language of the internet.
 
@tereško your native language is similar with English? (your letters are the same) ?
 
@Sajad letters are similar (though we have 33 letters in alphabet instead of 22), but that's about it. The structure of my native language is quite different from English.
 
6:12 PM
@iroegbu wait please ...
@tereško I see, also seems your language has funny "s" letter. the "s" in your name has something in the above it
 
it's spelled as "sh" from "shit"
 
ow
so your name is "tereshko" ?
 
it's a surname, actually .. people attempting to pronounce my first name would probably suffer some tongue injuries
 
@bwoebi It'll be fine...
 
@NikiC We'll see :-)
 
6:16 PM
oh really?! good. but it is hard. how your friends call you 'tereshko' all the time... I suggest to pick up a shorter name for yourself
look at my name, it is Sajad. too easy :-)
 
there are also like 1000 "sajads" on SO
 
also there are several "teresko" on SO
 
@Sajad Not so easy ...
At least I wouldn't be sure how to pronounce your "j"
 
as in "jam"
 
"Sajad" is not easy?! I think it is too fluent
 
6:20 PM
@tereško k
 
.. I'm guessing
 
ah ^^
 
@tereško correct
@tereško can you write your name in teranslate.google? I will hear its phonetic
@iroegbu does not work :-(
 
holy shit
 
wtf… Why is self:: also subject to Late Static Binding?!
 
6:23 PM
the pronunciation is terrible
 
I always thought only static were subject to LSB…
 
that's how I would have pronounced it?
@Sajad what exactly is the problem? You can't get the destination param?
 
@iroegbu why "anything" does not echo ?
hum @tereško? why "anything" in the URL does not echo ?
 
@Sajad please learn to use var_dump()
 
TIL: php.net/manual/en/language.oop5.late-static-bindings.php parent and self are also forwarding the called scope context…
 
6:28 PM
I want this output: echo $_GET['destination'];
http://localhost/myweb/search?s=islamic_sources&q=anything
 
@Sajad &q=anything is another query parameter… check $_GET['q']
 
@Sajad $destination = urlencode("http://localhost/myweb/search?s=islamic_sources&q=anything");
 
@bwoebi wut?
 
@bwoebi yes it is, but I passed all this in the one parameter:
http://localhost/myweb/search?s=islamic_sources&q=anything
 
2 mins ago, by bwoebi
TIL: http://php.net/manual/en/language.oop5.late-static-bindings.php parent and self are also forwarding the called scope context…
 
6:30 PM
that parameter named "destination"
 
I always thought self::foo() in a Class A would be exactly equivalent to A::foo()
 
that's what 'static' does.
 
ok well, there is anycode with this concept: echo all parameter after specific parameter ?
 
@bwoebi hm...
That seems odd to me
 
@bwoebi it's not compile-time?
 
6:31 PM
well, it's the same call… the difference is whether static context is forwarded or not
(see the last note (the dark grey box) on that page: php.net/manual/en/language.oop5.late-static-bindings.php)
 
@ircmaxell I just tried compile-time substitution and well… some tests failed.
 
@ircmaxell did you write it right now?
 
@ircmaxell 3v4l.org/tv83D
 
@bwoebi WTF?
 
6:40 PM
@ircmaxell precisely.
 
the self::foo() call is forwarding the static context of B to A…
 
@iroegbu thanks buddy !
 
I don't see the wtf, in the sense that it's always been like this.
 
@bwoebi is it? Or is it the static:: call that's forwarding the static context used by self?
 
6:42 PM
it's forwarded twice here
 
@marcio As none of us really use LSB, it's surprising...
 
I've used LSB… But not via multiple levels of forwards…
(Basically: just used static:: without self:: and parent:: calls…)
 
@NikiC if there is a reason I am surprised is because 3 of the most active maintainers didn't know that D:
 
lol
 
But that's how php is. I only learned that a function with the same name as its class was a constructor, when it was deprecated.
 
Another surprise is that HHVM mimicked it nicely.
 
Anonymous
7:10 PM
Are there any tricks for runing cronjobs based on conditions?
 
btw, @Sajad, did you finish the audiobook?
 
php Zend/zend_vm_def.h … 9000 lines of output? I expected 3… oh! ……… yea.
 
@bwoebi Happens to me all the time ^^
 
great that I'm not the only one that stupid ^^
 
was there any particular reason why short closures still need the function keyword instead of just writing ($x) => $x + $y?
 
7:22 PM
@bwoebi That branch around zend_vm_stack_push_call_frame looks ugly
@bwoebi How much does this improve?
 
@Gordon exactly the same issues from the first RFC
 
@NikiC Trying with time ./sapi/cli/php -r 'class a { static function x() { for ($i = 0; $i < 1e7; $i++) self::y(); } static function y() { } } a::x();'
1.306 vs 1.405
lowest of three runs each
basically: a single static self call got 10% faster.
 
@bwoebi and how does it impact a non-self call?
 
(the loop overhead is 0.4 sec)
@NikiC no measurable difference
maybe three instructions more [the branch] (no idea, didn't look…), nothing measurable at least
if there is any difference, it's less than 1%.
At least most code I look at, self:: is much more often used (in terms of runs at least, not necessarily in terms of times in code)…
 
7:48 PM
@Gordon parser constraints
 
@NikiC same for self::$prop now… 20% faster.
 
@bwoebi nice :)
 
We're optimizing so much that we end up having no optimization potential in 7.1 :-D
(Just kidding… Dmitry plans to bring CFG etc. to 7.1 anyway ...)
@NikiC I was asked to throw an exception when binding Closures instead of emitting warnings… What do you think?
 
@bwoebi He plans to work on that personally?
 
@NikiC yeah
 
8:03 PM
good to know ^^
was planning to do that as well
 
Well, not that we end up with the work being done twice :-D
 
yup
 
Well… when we do that SSA/CFG thing, we'll probably end up needing to check for certain funcs like get_defined_vars() and have some fallback so that everything still is properly set in cases where we'd otherwise be able to to constant propagation etc.
 
So there's going to be SSA as well?
I.e. in Zend and not just JIT?
 
Well, I'm not sure.
the issue with going CFG based on opcodes is that we are much more constrained than when we go directly to CFG/SSA from AST. (we need to take care of liveness of temps, brk_cont_array, can't randomly reorder as needed etc.)
@NikiC basically he said it depends on how slow compiling will become when doing SSA etc.
 
8:17 PM
@bwoebi yeah
 
@NikiC And there's that nice paper Anthony built his SSA/CFG upon…
25 mins ago, by bwoebi
@NikiC I was asked to throw an exception when binding Closures instead of emitting warnings… What do you think?
^ @NikiC hmm?
 
@bwoebi Well, did the warnings exist previously?
If they did, I think we oughtn't change them
 
@NikiC yes.
but I changed the message in some cases though…
/me dreams of clever code pipelining so that independent data paths can be processed transparently in multiple threads simultaneously…
 
8:34 PM
@JoeWatkins hey not sure when your ping was, but I'm here now, so pong? :)
 
9:10 PM
@Gordon nice article
 
@Gordon We would have conflicts in the parser. It would be difficult but it would be possible to resolve some of them. However, the conflicts with arrays and yielding key/values would require a shift/reduce resolution rule.
I don't even know how to do those.
I've seen "Solved by shift" and whatnot, but have no experience doing it.
The most brute-force solution is to not rewrite anything and throw %glr in there so it does parser backtracking. If there is a conflict it will try both and if one errors it will do the other (and still resolve the yield/array conflicts by a rule).
It's really ugly, honestly.
It is possible, I think.
It's more of a question of, "Is it worth the cost?"
 
9:34 PM
Not sure why Weltling has commits in here? All I did was rebase on master and push. github.com/php/php-src/compare/…
Eh, fixed.
 
@tereško chapter 8
 
I'm trying to change a value of all arrays inside one array. I'm using foreach. Now the problem i got is: the last array gets all the values from the second last array somehow
Do you guys understand my question? or should I make a example?
 
@PeeHaa what are you building?
 
@ircmaxell Git platform + ci in a proper language php
 
lol
code review?
 
:P
 
10:16 PM
that's what I want. A good code review platform
 
@ircmaxell The works
 
@ircmaxell that's the issue with band-aids… they remove pain ^^
 
some like gerrit but not at all like gerrit?
 
@bwoebi not in real life
 
Aug 20 at 9:15, by PeeHaa
@Jay Every time somebody asks me that the plans for the project have grown bigger :P In short; a self hosted git platform / project communication / code quality thing (which will eventually also run on rpi's)
 
10:17 PM
:-D
 
@ircmaxell even in real life… at least long-term.
 
@ircmaxell I might ping you once I reach the point of actually implementing the CR part to find out what is a good platform for it
 
@bwoebi if you put a bandaid on a stab wound, it won't remove the pain. It won't even prevent you from dieing
 
@ircmaxell obviously not… I'm talking about normal blessures…
 
@bwoebi sure. But in the computing world, you never remove the bandaid, because the only healing action is you
 
10:24 PM
and neural networks
<insert-fatalist-rant-about-developers-being-deprecated-by-watson-by-2050/>
 
@Ocramius we'll maybe not have devs who code… but we'll have devs who design code.
 
isn't that what we do today?
 
that's what indeed we do today
coding can be done by any monkey, given the instructions
 
we'll just move up an abstraction layer
 
@ircmaxell sure. But we won't code anymore at all…
 
10:30 PM
sure we will
It'll just be akin to the move from Assembly to PHP
 
Well, okay yea.
But you don't code assembly, you hack that together :-D
 
@ircmaxell So does that mean that PHP jobs will pay really well in the future?!
 
@NikiC ahahaha
 
@NikiC yes
@bwoebi today perhaps, but way back when
 
Well… /me waits for CPUs interpreting PHP natively.
 
10:34 PM
are you trying to convince the machines to rise up and rebel?
 
To update PHP, just update your µop definitions…
@ircmaxell page doesn't load for me… but I've seen it already I think.
@ircmaxell I already fear the day where we'll compile C to PHP… asm.js is … well, great but the generated code awful ^^
 
@bwoebi I actually considered writing a C to PHP compiler :-X
 
@ircmaxell PHP is still too slow for that ^^
 
for what?
 
10:41 PM
for interpreting C code at real world speeds
 
you say that like JS is even in the same neighborhood of C
 
@ircmaxell don't know, but isn't asm.js not only twice as slow or even less?
 
@bwoebi Well, yeah
asm.js is a transpiler
The resulting code is conceptually equal to a compilation target
You aren't supposed to try and read it :P
 
@bwoebi than -O3? Not even close for the general case
 
@MadaraUchiha just like I'm not supposed to read asm, right?
 
10:44 PM
@bwoebi No
Not in the same way.
Like you're not supposed to read the resulting JS from TypeScript or uglify.js
 
@ircmaxell well, I don't know actual numbers… maybe it was -O0, maybe -O3, don't remember.
 
Like you're not supposed to read C bytecode
(Except there's no bytecode for JS, however much some of us wish it had)
 
@MadaraUchiha uglify.js is just changing code without changing behavior
@MadaraUchiha What's C bytecode?
 
@bwoebi C compiled targets
Please forgive me, it's 2AM and I'm really tired
 
@MadaraUchiha well, then better… good night and sleep well :-)
 
10:51 PM
@bwoebi in certain cases, definitely it can be faster. In general cases, I highly doubt it
 
@ircmaxell well, I honestly don't know…
 
is anyone familiar with apache? i was in here earlier today asking why most php $_SERVER variables were returning the drive letter
$_SERVER['SCRIPT_NAME'] returns string(12) "C:/index.php" even tho i'm in C:/Users/me/sites/site/index.php
 
11:14 PM
@NikiC can you please look at github.com/php/php-src/pull/1506 … don't remember whether I asked you already…
 

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