« first day (1125 days earlier)      last day (3833 days later) » 

11:01 AM
@ThomasWeinert did you mean this ? it does not work (obviously) - am I missing something in your idea?
 
no, bwoebi is right, it would only work with at least one global function
 
ugh ..
 
<- still thinking about it
 
I'm trying another idea
yahoo :p
 
    $dbh = new PDO('mysql:host=localhost;dbname='.$fixedDatabase[0], 'xxx', xxx', array(
        PDO::ATTR_PERSISTENT => true
    ));
is there anyway to get the connection established time and end time ?
 
11:06 AM
\o/
built YAC tonight:
@iam_asm89 already the name is awesome! YAK: Yet Another Container :D http://t.co/TSWMiK183o
 
is there anyway to get the connection established time and end time ?
 
@ThomasWeinert @bwoebi ..and here it is :p
 
@AlmaDo difference to global var?
a static class var is just as global as a global var
 
huh, I'm not re-creating anything
i.e. no risk that I'll break something in outer scope
 
Imagine you have in outer scope a class named "classWithNoName"…
 
11:12 AM
What are the risks of using 5.2.6 ?
 
then it will fail - because there will be no definition of it inside function
 
what kinds of attacks are possible/
 
@Duikboot risk of using PHP 5.2 is that your ass'll be on fire :p
 
:D
 
@Duikboot I'd consider using cgi with php 5.2 :-) </nonotreally>
 
11:14 AM
@bwoebi well.. it's sad that closure cannot be used
 
:D I have to make someone sure to upgrade
 
@AlmaDo yeah, wait for Dmitry
 
but I think it's still a good idea without that
wait a min
 
But I have no to add some information about the risks using a version that is released in 2k6
 
Hey guys, quick question on OOP. Let's say I'm making multiple API calls. Even an OAuth call as well. Should each of these consist of: (1) The class that does the call (2) A class Request object and (3) A class Response object?
 
11:19 AM
@Jimbo you can tweak OOPS according to your needs. What I mean by that is, you can drop few practises if you want. But I think if you want to follow a good design practise then you should have all these three.
 
@Duikboot The main risk is that people will point, laugh, and call you names.
 
:p
 
Aside from that, it's not supported, even from a security fix standpoint.
Critical remote vuln found in PHP 5.2? Don't expect an emergency release.
 
@Duikboot use 5.3 or .4 if you can. I dont think you will need to change your code. 5.2 is old doesnt matter if its stable or not.
IMHO
 
@bwoebi got that
@bwoebi not sure what will unregister_tick_function() do. Can you see? It's here
tests show that there's no method call in outer scope
 
11:27 AM
Argh working on a 5.2.x is making me angry
 
@Duikboot so your ass is on fire ?
and I warned :p
 
Exactly.
 
@AlmaDo haha, genius :-D
 
it's PHP room, just fyi ;-)
 
11:30 AM
@bwoebi but what will happen?
 
rly? I thought it was Russian politics and random office talk room. :o
 
@AlmaDo it searches for the function name, that's why it works?
 
I heard Putin got his 9dan in Tae Kwon Do.
Serious stuff
 
@bwoebi no. question is - will that be safe?
 
@SweetieBelle
@AlmaDo as long as you don't unregister a call_user_func_array in a called function^^
 
11:32 AM
@bwoebi :D
 
@bwoebi I think I'll add my answer to my question (but yours will remain accepted since it is the source of this idea)
 
@AlmaDo or just add the link to 3v4l to my answer
 
@bwoebi no, not only. I want to share my research - i.e. why I'm not using closure, that it's a bug in PHP e t.c.
 
@AlmaDo ah^^
@AlmaDo that research will be obsolete anyway next month I assume :-P
grml… php 5.5.6 is released, but not yet in 3v4l :-(
 
:)
 
11:42 AM
Simplest way to do what strpos() does but ensuring there's nothing either side of the needle? Example: "Hello World" with needle "ll" would be false?
in html
 
preg_match /^ll$/ ?
nvm didn't read the question
If there's nothing either side of the needle, then the needle is === to the haystack, isn't it?
 
@AlmaDo eval.in/67842 still a hidden global :-(
 
so strpos will always be 0
 
Oh, interesting...
Jenkin developers accidentally do "git push --force" to over 150 repos on github http://buff.ly/18nbrU6
err... WHAT?
 
@ThomasWeinert I've already resolved that: stackoverflow.com/a/19976894/2637490
 
11:51 AM
@Ocramius few days late :p
 
yeah, still
wtf
and why do they have 600 members in the org?
 
Was just typing... their org is a mess
they have all contrib projects under their org
 
meh
"let's build an accident"
 
Eh
How long does it do to do Git Commit art like this: github.com/IonicaBizau ? :|
Days of planning !
 
@MackieeE git commit --date="..." --allow-empty
then repeat over time
 
11:57 AM
@Ocramius Ahhh haha :D
 
@bwoebi well, I hope we've added some useful stuff to this stupid questions sh*tstorm :p
 
@JoeWatkins Oh awesome thank you :)
 
3v4l.org/StFmt sry dead code in that one ...
 
Today is a day of questions for me where I ask because I assume there's some pre-built function or thing out there I don't know about.
Can't say I see Do being used often.
 
12:11 PM
@MackieeE lol that's awesome
 
Hay Is there a way I can write this Query in a right way..
SELECT product_id,
count(id), ( select count(*) from products where product_path LIKE '%Electronics%' ) as IsEnable
FROM products
WHERE deleted_by IS NULL AND
product_path LIKE '%Scheduled%'
GROUP BY category_id
 
Anyone ever gone to a hackathon?
@ScoRpion Yes.
 
@Fabien I want "( select count(*) from products where product_path LIKE '%Electronics%' ) as IsEnable " this query return the value for the current product_id and not the same result
Could u please help me with this
 
You know what PhpMyAdmin is?
 
@AlmaDo which shitstorm?
 
12:25 PM
@bwoebi open questions page.. and you'll see it
 
everyone knows what phpmyadmin is! :D
 
@AlmaDo ??
 
@NeerajKumar I can't overestimate people.
 
@Fabien yeah.
 
@bwoebi there are lots of crappy questions.
ah, nevermind :p
 
12:28 PM
@AlmaDo What do you do for work?
 
@Fabien huh?
 
What's your job? :)
Or where*
 
@JoeWatkins, @Fabien I would use pcre for it, here is \b for word boundary
 
@Fabien ah.. that. Actually, I'm senior engineer :p but I'm doing nothing almost whole day cause each issue is done automatically (and I only need to maintain that).
 
@AlmaDo Sounds pretty sweet :)
Wish my code was that solid :P
 
12:30 PM
well, of course, I've created all that processes :p
 
@ThomasWeinert Makes sense.
 
@Fabien but sometimes there are bad cases (I'm working with partners, and they often doing sh*t so sometimes I need to work hard)
 
@AlmaDo heh. I feel bad for people who have to work on my code :(
 
12:32 PM
@Fabien :p
My code is not good too. But I like to test, compare, improve, e t.c.
thanks to @bwoebi I have light-weight tool for measurement now :D
 
@Fabien Do u have an idea about it
 
@ScoRpion Do you have PhpMyAdmin
 
i am using sql manager
 
@AlmaDo How do you feel about code you wrote 1 month ago? :)
 
@Fabien
@Fabien
i am using sql manager
 
12:35 PM
@Fabien well, I think it's average
 
@ScoRpion What happens when you run the query in there?
Assuming you can
@AlmaDo That's good then.
I looked at something I did 3 weeks ago yesterday and wanted to slap myself.
 
@Fabien oh, here's an idea: check this code: stackoverflow.com/a/19976894/2637490 without reading explanations and question. Is it good? Can you understand it? It's my latest code :p If you will be able to understand it, then my code is average or good. Otherwise it's bad
 
@Fabien I want the result of the subquery on basis of product_id for that row.. but it gives me count of all the rows.. i want it to return "( select count(*) from products where product_path LIKE '%Electronics% where product_id = "current fetched product "' ) as IsEnable" count for the selected product_id
 
@AlmaDo Uses some words I haven't googled yet but it makes sense.
 
oh, I'm glad then
so my code can be understood
 
12:40 PM
@Fabien Did u understand my issue \
 
@AlmaDo ternary styling isn't my favorite though :P
 
@AlmaDo stackoverflow.com/posts/19976894/revisions :-P don't implement so buggy code :-P
 
@ScoRpion The issue is you're not testing your query, and if you are you're not listening to the resulting error.
 
@bwoebi will it be error? huh..
 
Hello everyone :)
0
Q: uploading .ini files in CI

ChristopherI get following error when trying to upload .ini files "The filetype you are attempting to upload is not allowed." Below is the function for uploading files private function _upload_config_file() { $config['upload_path'] = APPPATH . 'config/ini/'; $config['allowed_types'] = 'ini'; ...

 
12:44 PM
@AlmaDo lu1.php.net/call_user_func_array docs say it expects exactly two parameters
 
anyone interested in solving this issue ?
 
@bwoebi ah, got that.. error_reporting hided that from me
thank you
 
@AlmaDo baaah… error_reporting buuuuh!
 
it's not a fatal
@bwoebi for a sandbox.. why not?
 
Right, that’s it, hands up who keeps telling Marketing departments that people actually use QR codes?
 
12:46 PM
@AlmaDo I always have E_ALL (e.g. even E_STRICT and E_NOTICE) always active
 
good idea. I've changed my option to -1
 
@ThomasWeinert eval.in/67881
 
@JoeWatkins I am not sure about that, what is if your code goes into the loop on a larger text with several occurences?
 
regex is for complicated parsing of textual information, not breaking things apart and checking for spaces, you have absolutely no chance to make a call to preg any faster, what's more, if you heavily use it throughout your application you populate many many caches that you will never use, slowing down everything ...
 
there's a limit on the string length you can run a preg_match() on too. Worst of all, if you exceed that limit PHP fatals silently.
 
12:51 PM
When you guys unit test something that requires a specific (non-hintable) parameter type, do you test that all other types cause an exception?
 
@SweetieBelle we do use QR codes in a factory that needs them for automated machinery...
 
Fabien. main problem should be the size of the match, not the subject.
 
@SweetieBelle We encode binary data to a base64 URI, and create QR code from it. Then, we encode the binary image data of the QR code into a base64 URI, and create a QR code from it.
function qr() { qr(); }
 
@ThomasWeinert thats not properly formatted text, that the sort of thing you might use patterns with, if you are just dealing with properly formatted text, and are checking for spaces it doesn't make sense to use regular expressions ...
 
1:04 PM
This is an example to trigger your loop
if your loop triggers, the string version will slow down
not because of the string functions but the function calls in php
 
PCRE is slower then some string function calls, but faster then a lot of them
 
bye bye
 
of course this is all micro optimization, should not be relevant either way in the most applications
 
@JoeWatkins: I'm a little put off by the fact that people are saying to pull your debugger work in without an RFC...
 
1:13 PM
@ircmaxell it's just a sapi like an ext… nothing "internal"; but true, a RFC wouldn't be bad in that case.
 
it's not about "wouldn't be bad", it's about consistency
and predictability
and leaving power in the community instead of a few people who say it's ok to merge or needs an rfc
 
@ircmaxell well, consistency and predictably wouldn't be bad :D
 
@ircmaxell I don't see any RFCs about ext bundling in the rfc list
 
ZO+ was just an ext, nothing "internal"
 
@ircmaxell but with deeper integration planned
 
1:15 PM
any non-trivial change to the shipping package should require an RFC
that's the whole point of an RFC
after all, the community will need to maintain the code once it's in
 
@ircmaxell yes, yes, but first let joe and Felipe finish their sapi…
 
@ircmaxell that's about exposing as ZEND_API, not especially for bundling that
 
1:36 PM
do PHP streams automatically close when it reaches feof?
 
@hohner no.
they close when there's no variable referencing the resource anymore.
 
okay. is it typical to have a file locked during the time its associated with a stream?
somebody's having trouble deleting it while the fopen resource is still alive
 
what OS is the file on? I believe windows will lock files with open handles usually
 
not sure. i'm using OSX and i had no trouble.
he's using: $tmpFile = sys_get_temp_dir() . '/testfile.txt';
 
Anyone know of an URL which has privacy on it's whois? or own one?
 
1:43 PM
url? may be domain ?
 
Aye domain.
 
@Fabien do you mean this ?
 
Perfect thanks
 
it's my domain
e.g. only domain :D
 
heh. It's exactly what I was after. Just needed something to test if I can detect it.
 
1:47 PM
well, I've registered that on myself but through privacy protect
current domain's owner (I mean site owner on it) knows nothing about that
 
oh lol
How come?
 
?
I know site owner, but I have nothing to do with that site. He just asked me to register domain since he's totally noob in that
that is because I've registered with protection
 
Ah I understand.
 
my only requirement was that web-site will be legal :D
 
Just finished reading about this Google Dart :|
Another Google GO?
 
1:54 PM
Google Dart Weider?
 
well it seems interesting
 
user1642018
how can i do the multi-threading in php curl get headers only
 
user1642018
all available class shows examples of getting data instead of getting just headers.
 
user1642018
2:08 PM
i am trying to calculate the file size of millions of files.
 
user1642018
using curl.
 
@AlmaDo Hahahah :D
Sweet :)!
 
What options are there for general intermediate semantic content persistence? Something that I can write processors for, and have it transformed/compiled into (X)HTML, PDF, etc. I've been looking for XML schemas/standards, but really the only ones that come up are DocBook.
Something non-specific to a given industry; just general content publishing.
I was writing a schema, but I stopped before I went insane.
 
@DanLugg More insane? ;)
 
user1642018
anybody ?
 
2:22 PM
back
 
guys, can someone give me an explanation why PHP does not support a user defined class down-casting
 
ummm, because why would you?
 
what is that?
 
morning
 
@mamdouhalramadan PHP doesn't support non-scalar non-built-in casting. Period.
 
2:28 PM
hi, @NikiC
 
that's my main question. I was asked during the interview about this idea. and I said I believe there is nothing in php (explicitly) do a user-defined class down casting
 
@cspray Bananas in the wind! David Copperfield is the devil! PHP runs my refrigerator!
 
@DanLugg I will hax0r your milk with SQL injection!!!1
 
INSERT INTO `orderQueue` VALUES ('milk', 99999999)
 
First reaction (our admin) to my arduino project: "Do not touch the coffee maker!"
 
2:30 PM
lol
 
@mamdouhalramadan why is it sad? What's use-case where it's necessary?
 
ARDUINO AND RASPBERRY ALL THE THINGS!
 
@AlmaDo - I couldn't think of one, specially if the code is properly implemented.
 
@mamdouhalramadan then @ircmaxell's answer is good enough for you
 
yes it is. But, I was wondering since this question popped up in my face during the interview and I couldn't answer with more than my previous words
 
2:34 PM
huh.. it's considered as bad in many languages
 
imo, that's a pretty horrible interview question
 
the answer is because in a weakly typed language, class **down**casting makes no sense
 
you could answer that it's breaking LSP so it's bad and, thus, PHP is advanced :P
 
hahah good one
so what about DCI would it require a class cast?
 
@ircmaxell huh, fair enough, but since in PHP we can tell which class is our object .. I'm not sure it's the only reason
 
2:36 PM
or I am out of the road with this question
 
PHP has no return-type constraints, when you return a concretion, the client code doesn't receive an abstraction, docblock or not.
So just because the documentation says "returns a FooBase", doesn't mean it doesn't return a Foo.
Rather, doesn't mean the client code can't operate on it as though it were a Foo.
 
@mamdouhalramadan in static languages down-casts are useful, because you are basically telling the compiler which interface you care about
 
@ircmaxell - great, then I should have said, as long as PHP is an interpreted language, it wouldn't make sense to cast to user-defined class, but it might make sense with compiled languages
 
@mamdouhalramadan It would make sense in statically typed languages.
 
php is not interpreted
 
2:40 PM
27
Q: How to Cast Objects in PHP

user267599Ive some clases that share some attributes, and i would like to do something like: $dog = (Dog) $cat; is it posible or is there any generic work around? Its not a superclass, or a interface or related in any way. They are just 2 different clases i would like php map the attributes from a cat cl...

 
@ircmaxell - [is php interpreted or complied](http://stackoverflow.com/questions/1514676/is-php-compiled-or-interpreted)
Am I missing something here?!
 
19
A: Cast the current object ($this) to a descendent class

ircmaxellCasting to change the object's type is not possible in PHP (without using a nasty extension). Once you instantiate a object, you can't change the class (or other implementation details) anymore... You can simulate it with a method like so: public function castAs($newClass) { $obj = new $ne...

@mamdouhalramadan anyone who says php is interpreted is abusing the words
it is most definitely not interpreted
PHP runs on a virtual machine
 
well I do respect your words, so please help me understand this point in more details :D
 
if it is, then Assembler, C, Java, etc are all interpreted
 
haha
 
2:42 PM
interpreted means that the parser and the "executor" happen at the same time. Meaning one line of code is read, and executed together
BASIC runtimes work this way
 
By that definition, what would PHP be?!
 
PHP and Java both use virtual machines. Which means that the code is compiled in one step, into an intermediary form (bytecode). That bytecode is then run on a "machine".
The reason this is important, is that you can build hardware VMs. And indeed Java has them
so you can run "compiled Java" natively on a special CPU
so the whole "native vs non-native" doesn't really hold water for differing compiled from interpreted
what the real difference comes down to, is interpreted reads the program as it executes, where compiled processes the entire program (or source file) into an intermediary, before executing it
 
@ircmaxell any reason why PHP docs, community don't use the word PHP VM like the java guys use JVM
 
@ircmaxell - you should add this on your youtube channel, as I think it is a myth among developers that PHP is considered to be an interpreted language.
 
I have no idea why the non-internals community doesn't call it VM
 
2:49 PM
take a look at this
 
@ircmaxell hypothetically is it possible to come up with a language like scala, clojure ( runs on jvm ) for but for PHP ?
 
hypothetically? yes
 
@ircmaxwell maybe because the compiling process is not as visible
 
lol ircmaxwell,
@ircmaxell good wording
 
@ircmaxell - really thanks for the clarification
 
2:52 PM
Dear people, there is no "w" in my screen name. That is all.
 
sorry
 
@ircmaxell that's been ircmaxwelling up inside you, huh? ;]
 
@ircwmaxell there's not?!!
 
@ircmaxell how are you called? wircmaxell?
 
@bwoebi Just noticed you were in the Dart room, you had some experience with Dartlang then? :o
 
2:55 PM
@MackieeE no, it was just because I had there a room to talk with certain people I wanted to talk to.
 
aha nevermind then =) Sorry!
 
@MackieeE The Dart room is an undercover PHP room ;)
 
@mamdouhalramadan Don't do what Danny Don't does. It was covered in the linked question, but I did it for the lulz.
 
@NikiC And the PHP is really just an undercover C room.. ;)
 
So, is the C room an undercover VB room?
 
2:58 PM
'morning
 
@DanLugg be careful what you say
 
@MackieeE We have a separate PHP room for that ;) Though recently it kind of moved back in here, so you're right
 
@ircmaxell I said VB, not VD. (though they aren't dissimilar)
 
in some ways, saying VD would be less insulting
 

« first day (1125 days earlier)      last day (3833 days later) »