« first day (1858 days earlier)      last day (3094 days later) » 

12:11 AM
@bwoebi possibly a stupid question; would it be possible for a PHP extension to give warnings/errors when a function or class is used with the incorrect case compared to how it was declared?
 
Abe
@DanLugg you meant deserialization or serialization?
i would say parsing is a technique, synonym of "traversing"... while deserialization uses parsing and returns the result of the transformation. for instance you can parse something and not getting any output, like for syntax validation, analysis, etc. as opposed to deserialization which is one of the possible uses of parsing. makes sense?
 
1:01 AM
@DanLugg What is the purpose of life?
 
Abe
42?
 
1:18 AM
@LeviMorrison Net pleasure?
Hedonism ftw.
 
@Danack yes, the opcodes store two literals, the passed and the normalized (aka lowercased) names.
but I don't recommend doing it… after all there are some places where people will be annoyed… "was it WebSocket or Websocket"?
 
Are the defined names stored? function FoOBaR()
so if you call it as fooBAR, the difference between the calling and called versions can be seen?
 
not sure, I'd need to look it up…
 
ah don't worry - was just wondering about if it even would be reasonable to introduce case sensitivity.
without too many people complaining.
 
well, yeah would be possible
function names at call and callee sides are preserved.
 
1:32 AM
I was thinking that rather than just introducing it in a new version and it being a big shock for people to have to figure out how much of their code is broken, if it's possible to make an extension that does the detecting, people could start correcting their code way before the introduction of case-sensitivity is enforced by the engine.
 
1:45 AM
@kelunik but but my private repos are forced push all day
oh, it's opt in :)
@Danack case sensitiveness itself would be annoying but if it comes as the effect of something else like a unified symbol table, maybe.
 
annoying? it'd make at least some stuff be less annoying for me.....
 
annoying in terms of bcb to the complainers from previous threads, but for me it would make things much better too ^^
 
hence the idea of an extension that allows incorrect case-spelling to be detected in a 7.x code....to give them a couple of years to learn how to spell.
 
it also bothers me that constants are case sensitive and all other things are case insensitive :/
 
Worst replies get to be in my Keynote at PHP World :-D #PHP #Leadership https://twitter.com/TessaMero/status/666059255338762240
 
1:59 AM
@kelunik yeah, totally shitty feature :-D :-D :-D
 
@Andrea ^ shitty port of github.com/TazeTSchnitzel/newType with macros
 
5.5.12 thinks 1a passes:
if (isset ($_GET['acceleration']) && filter_var($_GET['acceleration'],
    FILTER_SANITIZE_NUMBER_FLOAT))
is it fixed?
 
why are you using filter_var?
 
what should be used?
 
Abe
@marcio wait, can i emulate private classes with this
 
2:09 AM
@ircmaxell what should i use if not filter_var?
 
an api that actually works?
FILTER_SANITIZE returns a sanitized version. So you're doing isset(1) && 1 which is true
 
Abe
@ircmaxell rofl :D
 
filter_var sucks
 
@Abe I'm afraid not, it would be really really tricky do to outside language core. Like: 1) generate the class name with some obfuscated suffix 2) store it on your own global class table 3) use a global macro to fetch and deobfuscate the "private" class name... not worth it. Some things must be core language features.
 
i'm looking to do it directly on the if statement
 
Abe
2:13 AM
@ircmaxell i don't like complaining about php stuff, especially new stuff, but that is my thought too
 
filter_var isn't new
 
Abe
it is relatively new
it's so much of a mess that i just can't trust it
 
5.1 or so?
 
Abe
5.2
 
does anyone know if that's still a bug in filter_var?
 
user895378
2:15 AM
filter_var is terrible.
 
filter_var - (PHP 5 >= 5.2.0, PHP 7)
 
@3.14159265358... it's a bug in your code
@Abe 5.2 is still ancient
@3.14159265358... github.com/ircmaxell/filterus
3
 
Abe
@ircmaxell cool, will look at it for my next project. if you want i will PR changes for php7 support (class String etc)
 
go for it
/me will be happy
 
Abe
:P okay, i'm pretty sure i will choose shitty names though :D
 
2:26 AM
:-P
 
Abe
do you think "boolean" will ever be reserved?
 
dunnpo
 
Abe
Float -> Floating
Int -> Integer, Integral
Object -> Obj, Instance
String -> Str, CharList, CharSequence, Bytes, ByteList, ByteSequence
 
Can any one recommend a good comment system? I don't need much, I just need to be able to associate comments to specific projects, edit comments, delete etc. basic stuff.
 
you also need to alias on <= 7
so that it continues to work
 
Abe
2:31 AM
eh, i wish i know how to do that :D
is it even possible?
 
class_alias
 
Abe
won't it break php7?
ok maybe i know how to do it. will try once i get the time
 
that's why you surround it in a conditional
 
why would boolean need revision?
 
I'm doing research on it now for comment system
 
Abe
2:37 AM
isn't it better to have a different branch for php7? it's not a huge lib, class_alias and stuff would be a bit too much effort than necessary for something this small
 
where is the git for the php core?
 
@marcio that's more like a type alias, but nice :)
newType is an awful eval hack anyway
 
Abe
@marcio would be cool to have :(
 
proper macros would be kinda cool
(with severe restrictions)
Oh yeah.
 
@ircmaxell how do I fix the code you pinged me on?
 
@Abe there is an RFC for private classes. I believe it could go inside php 7.1... go bug the author!
@Andrea that macro is totally broken btw, it matches the last segment of Foo\Bar\Username the same way it does for Username, gotta fix that.
 
Abe
@marcio LINK! :o
 
@Abe dammit, I can't find it :(
no rfc, just pull request apparently
 
@marcio TY
 
Abe
@marcio i'm almost sexually excited about this
though i'm not sure about private class x. perhaps would be better having ns-private function __construct()
so that other methods can be public
 
3:03 AM
oh no, this is more on the "friend class" domain
hmmm, not sure about this wiki.php.net/rfc/list_default_value :/
anyway, good night all.
 
Abe
good night!
 
Abe
3:19 AM
i hate when they ask me "do me a export to pdf/doc/xls thingy". like browsers can't print/display text/display tabular data
 
3:37 AM
hi hi! i have a question
how to convert a date string into microtime format?
help me please! :|
 
@marcio I'd suggest looking at the code it would lead to from the PR....
list($a, list($b, list(list($c=100, $d)))) = array();
seems pretty unpleasant.
 
Abe
do you know if there's a way to call a function within the "" syntax? <div><?="foo {html($var)} bar"?></div>
html() escapes html
 
3:53 AM
$helper   = new getConnection($dbh, getConnection::branch($_SESSION['branch']));    I'm accessing static array withing  the constructor arguments ? . Is that safe ?
 
Abe
$h = function($h){ return $h; };
$var = "foobar";
echo "<div>{$h($var)}</div>";
someone using swiftmailer around? is there a way to use it async-ish? it takes too much time to send emails within transactions and i'm getting sporadic deadlocks i would love to get rid because of that. do i have to solve it myself or there is a way to solve it automagically?
aw english's getting worse. should go to sleep
 
why this syntax wrong ?
$key = getConnection::branch[$branch]
PHP Parse error:  syntax error, unexpected '[' in
 
4:30 AM
no
it's a static array
 
hello guys
hope u all r fine today
i need your help
 
no i got fever
 
ha ha ha
nice one get well soon sir
 
Abe
@underscore ClassScope::$variable
$object->variable
 
4:45 AM
i used
	public static function getBranchNameFromCode($code){

		return self::branch_code[$code];

	}
 
Abe
self::$branch_code[$code];
 
ah yeah
:D
 
Abe
also don't use static at all
 
reason ?
 
Abe
there is just one reason for static fields to exist, and your code isn't it
reason, it's not oop and it's totally redundant with regular fields and methods
 
4:47 AM
$helper   = new getConnection($dbh, getConnection::getBranchNameFromCode($_SESSION['branch']));
 
Abe
why your class is named like a getter
 
it's wrong
i'm not following PSR
it's my bad
 
Abe
i'm not following psr either, but that's just wrong
$branchesMapper = new DefaultBranchesMapper();
$branch = $branchesMapper->getBranchByCode($_SESSION['branch']);
$connection = new Connection($database, $branch->getName());
i made up the names because i don't know what you are doing. the point is that you should forget about static
 
moin
 
Abe
hey!
 
user895378
5:18 AM
o/
 
2
Q: Magento notice message issue

Deeban BabuI used below code in breadcrumb template to display the notice and messages <div class="GlobalerrorBox"> <div class="container "> <div class="message fL"> <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> </div> <div class="fR"><i class="fa fa-times"></i>

 
5:38 AM
moin Joe
 
Hey, am pretty bad at backend dev so need a little help.
I have a form and i need to call a function as form action. The function doesn't have ny returns. It just submits data to mysql database. Is it possible?
 
6:00 AM
action
The URI of a program that processes the form information.
 
6:15 AM
hi
anyone with wordpress exp/
 
6:28 AM
@MadaraUchiha hey good luck for election, I know its bit late but you got my vote
morning
 
6:40 AM
@ircmaxell in phalcon they used a lot of static methods in their model class. i guess it's a bad practise ? github.com/phalcon/cphalcon/blob/master/phalcon/mvc/model.zep
 
@ArijitMukherjee Don't ask to ask, just ask :)
 
http://blog.bachateraho.com

the home page post show the full post instead i want a read more link after certain words so

I installed post teaser but its not working properly so need help for similar plugin
 
@underscore it is considered bad practice, correct.
 
what the hell of that framework ?
 
@ArijitMukherjee You will probably find better help regarding administration in a different place. we code here ;)
 
6:46 AM
hi guys, i've been using classes more and more recently.
i'm wondering, whats the difference between these two:

`$dude1 = new Person();`

and

`$dude1 = new Person;`
 
@BurningCrystals no difference, one is shorter ;)
I prefer the second one
 
Abe
@BurningCrystals no difference, but use the first, for consistency
 
@ErikLandvall sweet! i prefer the second one too. (Y)
 
one diff
1st one have two brackets to the end
 
6:49 AM
ty Sherlock
XD
 
also
 
Abe
rofl
 
your php file will be increased by extra 8 bytes ? am i correct ?
 
6:51 AM
I prefer with parens
 
Abe
you mean 16 bit, or 2 bytes @underscore
 
we should get a poll for this
 
Abe
@DaveyShafik good man
 
@Abe i dont remember. 8 bit for a letter ?
 
Abe
@BurningCrystals no. just use parens. a kitten dies every time you write new Class without parentheses
 
6:52 AM
:( mmmkay
 
Abe
always works with kittens
 
So I had am issue all day yesterday, A very strange behavior I can't seem to solve. For some reason, during a routing and dispatch process, the status code is set to 501 if I use the request method "delete" or "put". Now I narrowed it down to an even stranger behavior. I have a function that only returns $_SERVER['REQUEST_METHOD'], if I change this to return "delete" instead, the problem with the status code disappears. @tereško @Danack @Charles
For you who are up now, the code it self is completly written by me, and is very simple. There's nothing in the code that states a 501 status code
Changing the method to:

      public function getMethod()
      {
        $method = $_SERVER['REQUEST_METHOD'];
        return 'DELETE';
      }

Works, but:

      public function getMethod()
      {
        $method = $_SERVER['REQUEST_METHOD'];
        return  $method;
      }

Doesn't :D
 
Abe
are you totally sure you aren't writing it?
magic guess, try setting auto_globals_jit = Off @ErikLandvall having it on caused me similar issues
 
7:09 AM
the 501? yes :)
will try that
 
Abe
looking at the code would help tho
 
Morning
 
@Abe the code 501 is actully set by the code I see now, but it's really strange how that could happend. Doing a var_dump on the method, it outputs "DELETE", so me changing to returning "DELETE" instead of getting it from that function shouldn't make a difference in my opinion. I need to set up a test case for this so I can show how it's reproduced...
 
good morning epodax
 
Anyone knows if putting "deny from all" in .htaccess file in a folder will still let users upload file in the folder or not?
 
7:27 AM
no luck with the : auto_globals_jit = Off @Abe thanks anyway...
 
Abe
so error in your code :P
 
No errors
If I do a var_dump right before, the code is never set to 501
 
Abe
since it's php i can't say "it's not possible" but "it's pretty much not possible"
 
and the expected output takes place, but it's like it takes different routes in the code depending on if I made an output or not
I agree with what you say, this is really rediculus
 
Abe
show the code?
 
7:31 AM
remeber that I notice that the 501 code is generated by my code. Just shoulkdn't be
the code is in no repository, and is in many abstractions to just pastebin in sensable way. but let me set it up.. hang on
So this is the core application
That line can be changed to return "DELETE" and it all works
if not, the code takes a different route
Which both returns a return value of true if I use the request method or jsut the string
 
Abe
first of all, why is Request coupled to superglobals?
should be: new Request($_GET, $_POST, $_SERVER...)
 
If you like to reproduce it, you could use the bashscript to set up a docker instance and use the gui.html to see what I mean
I can do that, I agree that would be better and easier to maintain.
 
Abe
and easier to test and debug
 
jupp
the whole handling of globals is just horrific, so I tend to just leave it to this class to handle it, I use a reflection method to factor the services, why I don't wanna use globals in the argument. But I could set up a factory to take care of the injection
still though, there's no reason to believe that is causing the problem in this case in my opinion
 
8:08 AM
Hello,
I have a cron job
 
congratts :)
we a are all proud \o/
 
and I see after some time genrate lots of temp file
how I can restrict on new temp files
 
8:24 AM
@abe
Changing to "post" or "get", makes the same code work btw ...
 
Hi Guys,is it right option to use clear white space ob_clean(); function
 
Abe
i have no idea, also i'm not familiar (and possibly dislike) dispatcher routing, so i can't really help. i just think that you should wrap superglobals and methods like header() http_response_code() etc in one place only, so that it's easier to debug
 
@Abe make sense..
 
moin all! o/
 
@Abe Any pattern you prefer to this?
 
8:30 AM
@user3454479 what are you trying to do?
 
from ajax responses i am getting whitespaces. previously it worked well. but today did some changes and i am using previous functionality response have whitespaces
 
anybody know what is equivalent of preg_replace('/\s*,\s*/', ', ', $str); in MySQL? (using REPLACE())
 
Mornign
 
Good morning everyone!
Takes a swig of orange juice, splashes back in eye Oh, it's going to be one of those days.
 
Abe
8:43 AM
@ErikLandvall i can't really tell which pattern i'm using (assuming that i'm using one :D) but i dislike having headers set in several places. i send them with the response body, only after i collected them all
 
good mornings
 
@user3454479 if you are getting whitespaces from ajax call, you are probably doing something else wrong... read up on this
 
isn't that what trim() is for?
 
@Abe, yhea, this code I'm working on isn't complete, I'm trying to figure out a comfortable way to deliver what's dispatched. for the moment the returned value is a simple asoc array, I could make a view model instance that contains more then just the data, including the headers and status code for instance :) I made the changes to the Request class discussed
 
@iroegbu you shouldn't need to trim an ajax response.. If you need to trim that you are doing something wrong..
 
Abe
8:50 AM
cool, now have a Response class too, if you don't have it yet :P it shouldn't contain header() and stuff, but should just collect the headers, the response body, etc
 
Mornings
 
Abe
mornings
 
moin
 
@Naruto I thought the white space from client-side (request)... not response.
 
Abe
8:59 AM
@ErikLandvall though, it's okay to have a $request->send() method. it's not ideal but would save you some hassle
 
So, $request->send() always reminds me of active record even though it's not. I would use another object to send a Request object
But that's just me overthinking massively and probably not doing it right :D
 
Abe
yeah @Jimbo
 
@iroegbu while I read your response I started doubting myself if I had read wrong :P But your right when it comes to client side ^^
 
9:21 AM
\o
 
o/
 
o/
 
\o
 
o/
 
ThW
Morning
 
9:23 AM
We will never all be on the same page with continuous messages will we :P
 
Not sure about the if / else in the sender as that'll increase in complexity with new sender types. Sounds like you want a sender interface and a different sender for each one
FileResponseRenderer, PhpFileResponseRenderer etc... could be inheritance there
 
@Abe Why does a renderer have a send method instead of a render method?
 
Abe
@Jimbo how else would you do it?
things are just from string, from a php output, readfile and fpasstru, afaik
@PeeHaa because i suck at naming?
 
9:40 AM
good mornings
o/ o/ o/ \o \o \o
(looks a bit strange)
 
0/ @hakre
 
Why does the Response not have a respond method?
 
Not sure about that ^ (it could just be a value object)
 
Abe
:26920066 not as strange as:
o/
|      \o\o\o\o\o\o\o\o
 
2 hours ago, by Erik Landvall
we a are all proud \o/
That was flagged...
Wat
 
Abe
9:45 AM
@hakre what is the respond method supposed to do?
 
@Abe Sounds like the verb of Response, so it does the Response.
 
Abe
no way :P
 
But perhaps the Response does nothing but instead has collaborators, like some kind of Renderer.
 
sooooo I found a bug in libcurl! \o/
 
And the Response perhaps is actually a HttpResponse (HTTP as in Hypertext not as in JSON).
 
9:49 AM
turns out my code was correct :D
 
@DaveyShafik you want to keep it for yourself so the feeling lasts longer? ;)
 
@hakre nah, I reported it and the author already fixed it :)
 
@DaveyShafik now that's the way to go!
 
@hakre lol
 
so once I got passed that, I figured out why I had a endless loop and fixed that first try :D
 
9:51 AM
wow nice turnaround time that is - curl has good support.
 
I'm getting the hang of this \o/
@hakre it's amazing what being polite on Twitter and writing a detailed bug report will do :)
 
I ended up ordering some cards from that place @Jimbo :)
 
@Fabor Nice! Can you choose what you want on them then? What'd you get, or is it a surprise ;)
 
Huge multi-page form with too many checkboxes/dropdowns --- best way to store the options and user-selected option in database? Additional issue: how to store "other" text ?
 
Would it be doable to encrypt an encryption key using the username+password of users to prevent having to have a cleartext key on the server?
 
10:03 AM
@Jimbo Yeah, can have a full 55 image deck if you want. Great present for the holidays. I got 7 packs for my friends and me with photos of us all looking as stupid as possible (usually intoxicated)
£13 for a 55 image deck
 
i.stack.imgur.com/0H81O.png <--- database design for something like this?
 
Do you want to reuse the other option?
 
0
Q: Rigged elections 2015?

CSᵠThere seems to be a negative downvote count for candidate josilber Not sure what to suspect here, or if the calculations are done right. It seems as the total count would subtract the abs DV value from the UV though but who knows what's actually in play here. Disclaimer: I'm not part of any sid...

 
@PeeHaa There's no need for me to... but if it simplifies MySQL or PHP code, I'm fine with it. As long as the user does not know I 'm reusing it.
 
10:09 AM
@CSᵠ
 
@PeeHaa check again
also, mod answered, makes sense, but has no sense
 
@CSᵠ That makes no sense at all :P
 
Going crazy searching for similar questions but don't know what keywords to look for.
 
@PeeHaa that's what i said :)
 
Wait wut
The same thing applies to questions too. If the number is below 100, the sign is shown (for both up- and downvotes), but omitted if larger or equal to 100. — poke 1 min ago
Never noticed that
 
10:27 AM
neither... but elections get to 100 in less than 6 seconds
 
user3119231
11:16 AM
		$size = '9999';
		$delimiter = ';';
		$enclosure = '"';
		$escape = "\r";
		while (($data = fgetcsv($handle, $size, $delimiter , $enclosure, $escape)) !== false){
 
user3119231
why is this function importing with "," instead of ";" ?
 
@Maurize the variable name should be the answer to your question
 
user3119231
@HamZa can you be more specific, please?
 
11:34 AM
imagine if Facebook, instead of writing HPHPc, had gone and optimised Zend instead
we would have had PHP 7 five years earlier
 
Hello Everybody
 
@Abe Added a Response class that took care of all this as you sugested, and now the code works as sugested. Shows that good design is extra important in PHP.
 
I'm using php 5.5 with mysqli in e of my application. But sometimes the application suddenly expires it's session and told to login. Not getting what to do. Does anybody help me here?
 
The line that stated the 501 status code, if I changed it to throw a fatal error, then the code worked.. no error ofc ... so that code was never runned, but stil lwas somehow
@Abe ofc impossible, but you have the whole repo if you like to confront me on it ;)
 
Hello, any help please in my above question.
 
11:47 AM
How are you storing your sessions?
 
Using die(); at all?
 
@crypticツ $_SESSION["uid"] = $fetch->id;
 
@Andrea we wouldn't and that's exactly why they didn't do it. Because this would take a lot of time to discuss with community which Sara probably is a bit tired of
 
@Fabor Your commennt not clear
 
@Andrea but … but … the JIT.
 
11:51 AM
@ripa what I'm asking is are you using PHP's default session handling or do you have a custom handler?
 
default
 
Are you calling session_start() for each page?
 
yes
@crypticツ am I doing anything wromg?
 
@ripa I dunno, what have you attempted to debug the problem?
 
it's telling to login
 

« first day (1858 days earlier)      last day (3094 days later) »