« first day (1017 days earlier)      last day (4156 days later) » 

@PeeHaa I have a lot of docs there I need to upodate
Also turning off error reporting is like searching for a needle in a haystack blindfolded. — HamZa 27 secs ago
@ircmaxell Ah k. Better get to it in that case ;)
@Gordon Truth.
I'm off, goodbye guys
@dragon112 later
12:46
0
Q: Including content of php file in html page

KarimkhanMy php file is: <?php session_start(); if (!class_exists('FacebookApiException')) { require_once('facebook.php' ); } $facebook = new Facebook(array( 'appId' => $appId, 'secret' => $appSecret, )); $fbuser = $facebook->getUser(); if ($fbuser) { ...

> $appId = '669340023079549'; $appSecret = '390c04c60d19f38e113ea44f268aca44'; // Facebook App Secret
foolish ... op xD
@HamZa so what she copies? daddy gets the green tick :p
@Mr.Alien hehe
@Mr.Alien again its css answer :_P
@HamZa ;) @NullPoiиteя Oh yea :p

HTML / CSS / WebDesign

This room is now defunct. RIP.
user895378
12:54
You guys and your CSS rep-whoring ...
4
@rdlowrey lolz
user895378
No one in the php room cares about CSS answers :)
@rdlowrey that's incorrect :o
@rdlowrey true very true ... xD
@rdlowrey I'm more into regex :D
0
A: how to find specific pattern in array like this -> [number]?

HamZaJust use preg_grep: $array = array(1, 2, 3, '{1}', '{2}', '{3}', '[1]', '[2]', '[3]'); $new_array = preg_grep('#^\[\d+(?:.\d+)?\]$#', $array); $new_array = array_values($new_array); // re-index the array print_r($new_array); // print the results Explaining the regex: ^ : begin of string \[ ...

user895378
12:55
@bwoebi Then let me rephrase ... posting CSS answers in the php room is the shortcut to my ignore list.
E_TOO_MUCH_CSS warning is hurting my eyes :
user895378
Contradicting everything I say is also a shortcut to my ignore list.
@rdlowrey Yes we do :p
@HamZa preg_grep?!? what's this… lxr says it's just a loop over an array with preg_matches… what's the real advantage here instead of just foreach and preg_match?
you can use css chatroom it will be more active and also there is Wes and Mikedidthis(good guys) with other and by this way php user here wont feel bad ...
12:59
@bwoebi The advantage is no foreach and preg_match!
2
@rdlowrey ah yes, @rdlowrey is always right ;-)
@bwoebi lolwut ? Do you like the foreach+preg_match approach ?
@HamZa don't know… I just never heard about preg_grep :-)
I just mean… is there any difference?
@bwoebi Why do we have array_map(), array_walk(), preg_replace() with an array, str_replace() with an array... ? If we can just use a foreach and non-array-based version of the functions?
@NullPoiиteя I will be here and only here, am a PHP guy too, feel good and feel more good cuz CSS is awesome :p
user895378
13:00
preg_* === ULTRA SLOW ... and you want to put that inside a loop? Not smart unless you don't care that you can only serve a handful of responses per second.
@rdlowrey it makes really no difference, because regex patterns are cached
user895378
@bwoebi I've benchmarked it and it makes a metric ass ton of difference. You don't know what you're talking about.
user895378
6 mins ago, by rdlowrey
Contradicting everything I say is also a shortcut to my ignore list.
@rdlowrey going to benchmark myself
user895378
22 hours ago, by NikiC
I get aggressive talking to you
13:04
@bwoebi Benchmarking yourself... that's a novel idea.
Let us know how you perform. :)
@salathe Ah I then realise I'm on PHP 5.2 here, which means no preg_filter :(
@HamZa Call yourself a PHP developer? On PHP 5.2!
@salathe lol, that's my internship environment for you :p
13:05
Ooo.
@MaciejCzyżewski hi there
@MaciejCzyżewski Hi all! boooo, just realized I am a copy cat
user895378
@HamZa lol when you say, "I'm on PHP 5.2 here," all I hear is, "We just invented fire and we're working on the wheel next. Might be one day we'll invent solar-powered calculators? Perhaps."
8
user895378
(sorry for super-ping)
hahaha ... lol
13:07
@rdlowrey hey hey, I got PHP 5.4 at home !
It's super boring that I can't use my anonymous functions
@Neal Hehe
@MaciejCzyżewski :-P
@HamZa I have 5.5
@MaciejCzyżewski great
in HTML / CSS / DOM / webdesign, 7 secs ago, by Mr. Alien
@mikedidthis I don't ask questions
13:10
@PeeHaa hm?
@rdlowrey Ooga chaka ooga chaka is valid syntax ;-)
@rdlowrey hm. you're right (like always :-P) … preg_grep is about 3 times faster than preg_match in a loop.
@bwoebi and it's fancy !
user895378
@Bracketworks Yeah ... it's why I just when I hear people talk about using HHVM. I'm like, "Yeah that's cool that it's fast. Too bad it doesn't support any good language features and thereby results in terrible spaghetti code PHP."
@rdlowrey HHVM is only 5.2 compatible?
13:15
@PeeHaa is unactive?
6
A: Turn Plain Text URLs into Active Links using PHP

Maciej CzyżewskiYou may wonder how it works. I'll try to explain how it should be done by various methods. We'll start first with how regex works and how it is used. Regex - Regular expression In computing, a regular expression (abbreviated regex or regexp) is a sequence of characters that forms a searc...

More aobut regex
about*
An how regex works? — Gryfny Hanys yesterday
lolol
@NullPoiиteя exactly ...
@MaciejCzyżewski You've put a lot of efforts in there. Unfortunately, I think it's not in the appropriate place
13:16
@NullPoiиteя Such a quality answer, and what he gets is How RegEx works
@HamZa sorry
xD
@rdlowrey question: what is slow there? the foreach loop (internal loop far slower than foreach loop?) itself or the use of preg_match?
user895378
> Off the top of my head, the main features missing at present are namespaces and short array syntax, which we plan to add in the coming months. Also, there was some missing functionality with closures, but we've recently fixed that and the fixes should make it to our open-source github repo soon...HipHop currently supports a few dozen of the popular Zend extensions, but there are still several popular Zend extensions that haven't been ported to HipHop yet.
user895378
@Bracketworks ^
preg_match is faster
13:17
@rdlowrey sgolemon is quite confident about getting aligned soon =D
@rdlowrey Gotcha. Was just trying to find such a mention.
@MaciejCzyżewski no, I even upvoted it. There are dozen of duplicates of that question. Now your answer about explaining regex is just offtopic, it should better be in a "reference" kind of Q/A
user895378
@Ocramius I know, and if that happens it'd be great. But no namespaces = no thank you as far as I'm concerned.
user895378
I can't even think about using it without namespaces.
ofc. But I'd be happy to move away from php-src just to get far away from all those who still push this "shared hosting" thing that disappeared ~ 5 years ago from anything I do
13:19
@HamZa I know... Psssss. But I think is funny becous he write "An how regex works?"
user895378
@Ocramius I'd be thrilled to use HHVM ... but I have to have namespaces and I need support for a couple of specific extensions like libevent.
@rdlowrey heh, won't argue with that
@MaciejCzyżewski Well what I wanted to do is to create a reference for regex, from simple basic syntax to advanced and flavor specific concepts. The reason for this is to close all the RTFM and simple cases including duplicates against it. The problem: I don't have time for it, and I'm not sure if the community "accepts" it, they may close it ....
@MaciejCzyżewski Look at this, it doesn't deserve that much upvotes for such a simple thing. Spend 10 minute reading a tutorial and you could know it
16
Q: Strip out numbers from a string

Can LuWe have a bunch of strings for example: c1309, IF1306, v1309, p1209, a1309, mo1309. In Python, what is the best way to strip out the numbers? All I need is: c, IF, v, p, a, mo from above example.

hola people
@Hamza It's good idea!
This is a prime example of either the OP asking the wrong question or all of the answers answering the wrong question :) — vascowhite 14 secs ago
@MaciejCzyżewski Something like this stackoverflow.com/questions/3737139/… but then for regex
@HamZa I could write such a thing, becous I have time.
The next XXX amount of people who google for this will now find a quick answer. — Hard worker Nov 17 '11 at 15:20
lol
internet makes me sad
13
@HamZa Idea is very good becous... Stackoveflow have a lot of questions about regex. Some are extremely simple...
@MaciejCzyżewski and most of them are like give me regx for free
user895378
13:33
regexoverflow.com
7
@rdlowrey Haha
@tereško That was just awful.
@rdlowrey lol still waiting to see notconstructive.com
13:36
The next XXX amount of people who google for this will now find a quick answer. — Hard worker Nov 17 '11 at 15:20
@Rafee Sure thing. Don't have any plans yet, but I actually ought to go there again some time.
@Eugene hi
E_TOO_MUCH_NEWLINESHamZa 12 secs ago
^ @Mr.Alien
@HamZa I was going to try and fix that whitespace but have given up to go do something productive.
13:51
@Bracketworks yeah ... Well you might use regex :p
@tereško mh… you must be masochistic when you use internet then ;-P
lol
@MaciejCzyżewski huh?
13:59
#PeeHaa huh!
Omg... It's not twitter
@PeeHaa
What's new? Awfully quiet in here.
@PeeHaa Not sure I get it
@PeeHaa you can't write to a private variable, so a new public one is created dynamically
@PeeHaa urgh...
fantastic encapsulation breaking :S
@HamZa that question was crap
adfasdfasdfaf
14:13
@Daniel asdf.com
tyty
today is one of those days
14:26
Anyone who happens to have a hint for as to what to do when vmware player fails to run silently?
Buy a mac.
@Jasper What do you mean by "run silently" ?
@Danack not again :p
@HamZa I meant fails to run, without any output
@Jasper step over to virtual box :p
@Danack For a terminal server that's not my own? I think not.
Anonymous
14:30
@HamZa Do you do, unit testing?
@Simon_eQ I don't even know what that means
@HamZa yeah, I'll schedule that for the next time we do major maintenance on the system. Until that time, I do just need it to work.
Anonymous
124
Q: How to implement unit testing in PHP?

KevinI'd really like to start implementing Unit Testing in my projects. I don't know how viable this is to do in PHP. How can I do this?

Anonymous
@HamZa
I'm just going to try a reboot (and yes, that makes sense even though it's a linux server)
@Simon_eQ It's not the words in that sentence that are hard to understand, it's the structure of the sentence
14:32
@Simon_eQ well I need to grasp the concept before reading that
Anonymous
@HamZa I thought you used it, and wanted to know how beneficial it was. &@Jasper
@Simon_eQ Well when I code, I know it will work as expected. So I don't need to "unit test" it :p
blah!
@ircmaxell I know :) I just hate this behaviour
I would want something like E_STRICT to throw up when trying to set an undefined member
Unless I am missing some obvious reason where that doesn't make sense
14:36
@Simon_eQ How's it going, did you get a reply for the new job ?
I know
and I agree
<rant>
@PeeHaa stdclass
@NikiC ?
</rant>
Anonymous
@HamZa Fine I guess. I am waiting for a response.
14:36
@PeeHaa You wouldn't be able to use stdClass anymore
I.e. no plain value objects :)
@MaciejCzyżewski Everybody is busy :)
@ircmaxell now we can't star it :p
@NikiC whaaaaaaaaaaaaat a huge loss :)
I'm almost crying :D
@Ocramius I personally don't care about it, but I'd expect you to
You ORMies love using objects instead of arrays, right? :P
meh, last time I used stdClass was because I forgot the second parameter of json_decode() :P
14:38
cuz $foo['bar'] is ugly and $foo->bar is so beautiful ^^
@NikiC hmmmm :( So we can't have sane things because of other less usefull things? :(
@NikiC or @Gordon can you review this bio?
@Simon_eQ I've only recently started using unit testing (well, automated testing, I don't do true unit testing) and I feel it lives up to the hype. Despite having a test suite that takes way too long to run, I just love being able to make changes, and then simply run phpunit over it to verify everything is in working order before comitting
@PeeHaa I see :-D
@NikiC nah, I don't access public properties, except in very performance sensitive areas of the app
Anonymous
14:38
@HamZa don't let @Ocramius find out what you think about unit testing
Anonymous
4 mins ago, by HamZa
@Simon_eQ Well when I code, I know it will work as expected. So I don't need to "unit test" it :p
> Anthony Ferrara ist als Senior Architekt für die NBC Universal tätig und der Spezialist für Object Oriented Design, Anwendungs-Architektur und hochskalierbare Webanwendungen. Außerdem kann er Erfahrungen in den Bereichen Web Application Security und PHP Internals vorweisen. Auch hat er bei diversen Open Source Projekten mitgewirkt und engagiert sich aktiv in der gesamten PHP community.
> Darüber hinaus ist Anthony als ehemaliges Mitglied des Core Teams, sowie als Development Coordinator des Joomla! Projektes bekannt und war damals der Leiter des Security Teams.
@Ocramius I know that you don't access public properties. You access only the private ones with dirty hacks :P
Anonymous
@Jasper I have to give it a go today. Hope, it lives to the hype for me
@NikiC yes, and only after having extracted metadata for that
2006.
actually... much much before I was born
14:40
@Ocramius Uh, don't link this bad person in here...
@NikiC haha, he's just very good at trolling :)
@ircmaxell did you write it?
btw @NikiC what about magic get/set kinda things for std class? (don't know what stdclass internally does)
@Ocramius no, someone else translated it
@ircmaxell looks good to me (my german is not that good though)
@PeeHaa that would mean a lot of breaks. Just avoid using stdClass and use static analisys to find dinamically set properties and you should be fine I suppose.
@Ocramius I think you are missing my point
I don't use std class (almost never)
14:47
@ircmaxell s/Architekt/Architect/, s/für die NBC/bei NBC/, s/der Spezialist/Spezialist/, s/community/Community
your point is that it is possible to do that thing in your example
thanks!
@Ocramius My point is that it should throw up
@PeeHaa yup...
So saying just don't do that doesn't really count :)
14:49
@ircmaxell moving to Germany soon?
@igorw btw, I have this old project lying around: github.com/nikic/PHP-Backporter Didn't persue it further, but might be of interest to you
no, speaking in Germany in November :-P
@ircmaxell speaking German? :-P
I've got an array with some objects inside, and I want to convert it to an array. There's this "hack" using json encode/decode $array = json_decode(json_encode($object), true);. But is it safe to use ? Is it better than using a function like this one stackoverflow.com/a/2476954
14:52
Just imagining German with a New Jersey twang makes me cringe a little
@hamza It would need to be json_decode(json_encode($object),true) to get arrays or you could call array_map with the callback just returning the object cast to an array.
@leigh I thought twanging was limited to the south :)
@Orangepill well my question is if there are any risks using that json_* method ?
@hamza Not that I can think of ... should be pretty easy to test to confirm your expectations though.
@Orangepill Yeah, well I tested it and it works as expected. I was just affraid from maybe encoding problems or length limits. Note that I;'m on PHP 5.2 (facepalm)
@HamZa You use Linux, Windows or Mac?
15:05
@MaciejCzyżewski win, yes I fail by using win
@Hamza Lin is better for PHP
@NikiC nice.
@MaciejCzyżewski Just a bad habit, I should install linux
@ircmaxell it sounds a bit translated to me. I'd probably write
Ooo @Gordon
15:08
> Anthony Ferrara ist Senior Architekt bei NBC Universal und Spezialist für objekt-orientiertes Design, Anwendungsarchitektur und hochskalierbare Webanwendungen. Er hat langjährige Erfahrung in der Erstellung sicherer Webanwendungen und ist Mitglied im PHP Entwicklungsteam, sowie bei diversen Open Source Projekten.
> Anthony engagiert sich aktiv in der gesamten PHP Community. Darüber hinaus ist Anthony als ehemaliges Mitglied, Leiter des Security Teams und Development Coordinator des Joomla! Core Teams bekannt.
@NikiC ^
@HamZa I think json_encode has a depth limit but I'm not aware of a length limit. So you should be safe unless you are dealing with a deep heirarchy.
@Orangepill heh I see. It's actually a mysqli fetch thing ... That's what you get if you use php 5.2 ...
@ircmaxell but why can't you just send your english bio? It's not like you're going to speak in German, right? If it's an international conf it should have english bios. What conf is it anyway?
@Gordon I suppose it's a style choice on their part to have all bios in German
15:13
@Orangepill I am tempted to downvote that answer. It's horrible. The OP can solve all three requirements simply by writing parent::__construct() into the subtype ctor.
@igorw Backporting generators should be a lot of fun ^^
hey
can i use this ORDER BY id DESC LIMIT , but not set a limit?
@EliteGamer by removing the LIMIT ?
i know
15:22
i did, but i get some error
about the prams
More pls...
hm, oh, i mis typed something
my bad
:-D I know it!
@EliteGamer you should stop gaming a lot :p
ha, i hate when that happens
haha
i love it though
more fun than php, i can tell you that
15:24
@EliteGamer most of the cases it's a waste of time
yea, i agree.
not only time, but also waste of money
not sure about that.
XD
@EliteGamer heh, spending money to buy the newest game sets for example (headphones, mouse, keyboard ...)
@NikiC yeah, might actually be quite doable with CPS.
15:28
well, i guess
yea
@Gordon Removed my answer as being random monday morning noise and upvoted your comment :)
@EliteGamer or just buying all the games when there is summer steam discount :p
@Orangepill thanks
Anonymous
@Jaakko do error handling, and you don't have to use $GLOBALS just to get the dsn
15:34
@Gordon Symfony Live
@ircmaxell no true north then? :(
did they actually already pick the speakers for sf live berlin? :O
ah, nope
@ircmaxell oh sf … meh
I figured Berlin was worth visiting ;-)
15:41
@ircmaxell That's actually one of the things I am not convinced of but of course I can't tell since I never was there and have no intention of going.
@Gordon uh?
No.
I am fully aware that this is not an argument but pure bias :)
Ah ok
My experiences in Germany have all been good: Frankfurt, Munich and Nuremberg.
I can't even say why I don't like Berlin. It's just that the thought of Berlin always makes me go ewwww. I imagine it to be a dirty place. Full of rude people saying Icke, icke, icke all the time who pretend they can do curry sausages better than we do. Also I think they are suffering from illusion of grandeur and hipsterdom.
15:50
@igorw Why is "Binary number format" a missing feature? Shouldn't that come for free?
@Gordon it's like that in any big city? O_o
@Ocramius People don't say Icke, icke, icke here and we can do curry sausage.
@Gordon "pretend they can do curry sausages better than we do" that must be most hurting :D
@Ocramius but really, it's bias. Don't assume anything factual from that :)
/me doesn't understand the curryworscht thing... Is it this big pride stimulator? :O
it's a wuerstel with ketchup (simplified)
15:54
OH: "A cache without a discard policy is a memory leak."
@Ocramius well, you're from a country where the bacon has more taste than the curry-worscht, so ...
@Ocramius right. just like pizza is döner with different toppings
what?
@Gordon well played.
now it's getting crucial.
15:55
@Ocramius eat that (pun intended), italian!
rofl
I guess I just have natural tendency to be skeptic of anything people praise too much
@Ocramius what is pifke-land?
uhmm
Comes from this: imdb.com/title/tt0103510
haha. Are pizzas there really so bad?
16:04
I have stupid question. How long does it take to load techcrunch.com in yours computers? Becous I want to get Open Graph data. But it's take 5 sec!!!
@bwoebi well, the italian guy here is too lazy to make a decent one
looks more like a cake
Or like Gordon said... like a lamachun...
@MaciejCzyżewski 123ms for the html... considerably more for all of the assets
@bwoebi have one in Italy. It will make all other pizza's seem... flat...
Just like Gelato. I'm sorry, but nobody does ice cream in a way that can even touch Gelato from Bologna...
groan
16:22
Evening room
Morning
@Ocramius this type of pizza… No I don't like them :o I understand your problem. But I have eaten also normal pizzas in Germany.
16:38
@bwoebi I'm not talking about pizza hut
I'm talking about pizza attempts
16:48
hi everyone :D
Hi! @gr4devel!
What are you doing?
@MaciejCzyżewski hi man ;), just trying to implement the project of my thesis XD
Good luck!
@MaciejCzyżewski thanks man I really need a lot of it :D
ok let me shout it out to everyone XD
quick question: is there anyone that has ever used the PHP-Parser of nikic?
@gr4devel :-X
16:51
@gr4devel Very nice avatar.
@MaciejCzyżewski do you really like it XD
@gr4devel several of us here have projects based on it, so...
@ircmaxell oh! great! :D
@ircmaxell soo...can I proceed with my really question? :D
@ircmaxell *real question
16:54
@ircmaxell :(
you're limited to one question. That was your one question... Sorry and thanks for playing!
@ircmaxell mmm...man are you serious?!...you must be careful cause I believe you!
read the room description in the upper right corner of this page
@ircmaxell read it...no mention about the number of questions
16:56
@tereško was that for me right XD
> Discussion for all things PHP - Don't ask whether someone is here to help you. If someone is around and wants to help they will.
emphasis mine
@ircmaxell mmm...but this means that I should simply ask my questions and not ask in I can ask...
@MaciejCzyżewski .. I think you have got the point of this exercise a bit wrong
exactly
@tereško
16:59
/me joins, reads current conversation, leaves before bruising appears on face
2
@ircmaxell wait I think I know you
@ircmaxell youtube videos, wonderful tutorials, am I right!?

« first day (1017 days earlier)      last day (4156 days later) »