« first day (1682 days earlier)      last day (3266 days later) » 

5:03 PM
@rdlowrey now, feel free to rename your methods to use :-D
means… @marcio … pushed!
 
user895378
\o/
 
@bwoebi What is now allowed again that wasn't before cc @marcio?
 
user895378
Thanks for all the work you put into that patch @marcio
 
@PeeHaa Keyword names as class constant names and methods.
 
^ agree… Thanks a lot, @marcio
 
user895378
 
yay \o/
now the other patch
 
has anyone ever heard of a database table being deleted when you do a windows self repair?
 
Excellent
tnx @marcio!
 
@marcio which other patch?
 
the one I'll send
that enables method modifiers as class member names
it will require a separate discussion though, as it's off RFC
 
5:09 PM
Why are keywords sensitive on lexer? Wouldn't this be a good job for the parser to take the context?
 
that's what happens actually, the RFC name became a lie
 
Can I finally use List as class name now?
 
no.
 
@bwoebi you did it already
%expect 8 /* 6 because fucking traits */ :D
 
@marcio yeah, I thought that was decided… ^^
 
5:10 PM
ok, better this way
 
I can revert it if necessary if anyone complains…
 
no one will complain
 
@bwoebi Yep, revert it
 
@marcio just class will reduce/reduce
 
-.-
 
5:12 PM
Conflicts are a total no-go
 
@bwoebi because ::class
 
@marcio yeah
 
We should allow class with a few extra compile-time checks
 
you "can't" downgrade ::class to a special constant because static analyzers out there are already waiting for T_CLASS instead of T_STRING
it would be a BC break that wasn't voted, so I dropped this approach earlier and just reserved it
 
but wouldn't they still get it?
I mean, in normal token_get_all mode
 
5:15 PM
yes, in normal mode it would be :: T_CLASS and in parsing mode it would be :: T_STRING
 
Given how it is a separate mode that needs to be explicitly enabled, they can damn well adjust their code to account for that ^^
 
I'm okay with that if you guys are ok too, I was just avoiding obstacles to have the change accepted
 
I'm okay with it at least
 
@NikiC is this serious or just joke?
 
@marcio Serious
 
5:18 PM
because if we accept shift reduce for else / else if, there is no reason to don't allow it for <modifier> <name>...
it's exact the same grammar problem that we intentionally "designed"
 
The difference is basically that dangling else is THE conflict
It so conflict it has it's own name...
You always get that one if your language has a Cy syntax
 
so if culture allows it (based on other languages), it's fine?
but if you get the same pattern on a different situation it's bad
hummm
 
Can't you just add some magic %prec annotation to explicitly resolve the conflict?
 
will %prec work for that? let me try
 
I have no idea
just thinking it might
 
5:28 PM
Do you know some parser generator in PHP for PHP better than Lime? There is a lack of documentation for it and that's not so nice to write an entire parser "in hand".
 
hum, we'll probably need a different rule for each modifier... %prec is mysterious
 
@marcio Having separate rules sounds reasonable
 
raising %expect is less messy
@bwoebi s/Marc/Marcio ;)
 
@marcio well, it's sometimes Marc, sometimes Marcio
(e.g. twitter)
 
always use Marcio, Marc is like an alias for the lazy
 
5:33 PM
yes, %prec works
going to push that shortly
 
cool
 
@bwoebi great
@marcio Are you going to do a patch for ::class or should someone else?
 
Hi all, I have a query. I want answer from experts.
I was thinking of moving to Ruby On Rails as PHP devs are more and more day by day(Most of them are Cheap developers in terms of Code quality and Salary). So it is difficult for me to get well paid in herd of cheap devs. Should i move to RoR ? Or should I goto nodejs ?
 
First learn the difference between a framework and a language
6
 
Anybody see a problem with dropping $this support in $$var?
 
5:40 PM
@PeeHaa , yes sir , please consider me.
 
@NikiC I won't have time until Thursday ^^
 
@PeeHaa , sorry , but can you please answer?
 
@jQuery.PHP.Magento.com You should totally move to RoR
 
please specify why as well. Thanks
 
@NikiC I don't mind dropping any form of variable variable support :)
 
5:44 PM
@NikiC is there any specific reason to drop $$ for $this?
 
@marcio Closures could theoretically benefit
 
@marcio perf
 
Need to know if $this support is needed.
 
Just checked, get_defined_vars() does not include $this ^^
 
not that a specific reason is needed to drop var var, but perf seems enough to me
 
5:47 PM
So if you consider $$var to be get_defined_vars()[$var] that would be consistent ^^
 
Did you think about postfix conditionals?
 
the consistency card has no effect anyway, the perf card is much better
4
 
@HaskellCamargo god no
@marcio tru
 
Hello Everybody
So I had a question. When doing a database connection with PDO so I can call it only when I need to should I be making a function or a class?
 
PDO is a class
 
5:51 PM
oh ok
so I just need to make a function to store it.
 
Why do you need to "store" it in a function whatever that is?
What is the actual goal here?
 
to call the db connection only when I need to.
So before I do a query
 
Are you asking about lazy loading?
 
I don't know what that means
Well for example in the past I would make the database connection always on so no matter where I did queries it would always be connected to the database but our teacher told us we should only open a database connection when we need it for security.
 
For security?
That is utter bullshit
Please tell me he doesn't always say to always close the database connection once you have run the query
 
5:56 PM
here is how we did it in class

include '../includes/db.inc.php';
try{
$sql = 'SELECT * FROM users ORDER BY id';
$statement = $pdo->prepare($sql);
$statement->bindValue('id', 'id');
$statement->execute();
$result = $pdo->query($sql);
}catch(PDOException $e){
echo "There was a problem pulling users";
}
$result = $statement->fetchAll();
so see where it says inlcude db.inc.php I just want to call a function instead of that.
 
And what is the problem you are having with running whatever code is in the include in a function?
 
Hmm… using %prec actually always shifts using the empty rule… which is not what we want…
 
nothing the code works in the include but instead of ../../../ this trying to find the database connection I think it would be easier to make a function I could just call
 
@bwoebi how are you %prec 'ing it?
 
@marcio I tried all sort of combinations^^
this won't work with %prec
 
6:05 PM
me too ;P made a mess here
also tried to create one rule for each modifier + %prec
 
@bseekinsDEV You could create a function using a static variable, but I'm not sure I like thta
 
Yeah I'm still learning haha. There is so many ways to do things with PHP which is great because you can get pretty creative but I'm just trying to find ways to make it easier to call the db connection without trying to folder dive for it or back out 4 folders haha.
 
that's what works
\cc @NikiC
just clearly tell the damn parser what you want with explicit rules
 
but you won't allow the trait names to be aliased?
 
That's covered by trait_method_reference T_AS member_modifier identifier
 
6:14 PM
oh
huu
 
you need to specify both visibilty and name here…
 
raising %expect still seems cleaner xD
if bison can handle it, let it handle, but whatevs
 
no, actually
%expect shifts towards empty too
it even doesn't work
 
is it on the spec that to change visibility you need to supply both <modifer> and <name>?
 
?
 
6:17 PM
for example, is this allowed:
use X { someMethod as protected; }
 
yeah, that's why there are conflicts at all…
 
should it alias 'someMethod' as 'protected' or should it change method visibility?
 
it this weren't allowed, no issue.
@marcio method visibilty.
else it'd be a BC break
 
@bwoebi yes
this syntax was really bad designed
2
 
6:21 PM
agree^^
 
Bad syntax? Imagine (sarcasm).
 
Okay, pushed @marcio
It's now %expect 0 :-)
 
Hello, any wordpress-woocommerce developer here? :)
 
@bwoebi thank you
 
(and with %expect 0 I mean I have solved the dangling if/else with %prec too)
@marcio do you already have a patch for the T_CLASS?
 
6:29 PM
nope
 
Or should I solve that?
okay, few min
 
49 mins ago, by marcio
@NikiC I won't have time until Thursday ^^
I still think that downgrading ::T_CLASS to a special ::T_STRING should be asked on the mailing list though, just to be sure
 
@bwoebi yay :)
 
@marcio ehm… it's still a T_CLASS?
It just goes through semi_reserved
 
ah, I thought it was the same suggestion Nikita did a few minutes before
 
6:35 PM
@marcio hmmm?
 
@marcio Rule of thumb: Don't ask internals list.
3
(Applicable regardless of subject)
 
@NikiC Addendum: If necessary, announce something you're going to do, but never ask.
 
the one about doing ::class a reserved class constant and do it with compile time 'magic'
 
@marcio I'm going to do that. but it still is parsed as a T_CLASS
 
@bwoebi Again using %prec?
 
6:38 PM
@NikiC nah… I'm going to do that in zend_compile.c
 
k
 
class_name_scalar:
	class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS
		{ $$ = zend_ast_create(ZEND_AST_RESOLVE_CLASS_NAME, $1); }
;
^ will you keep this?
 
no.
 
errr, curious; go ahead.
 
Replace T_PAAMAYIM_NEKUDOTAYIM by T_DOUBLE_COLON would work fine?
 
6:46 PM
Also, while we're at it… can I just enable $dynamic_class::class ? @NikiC
 
@HaskellCamargo if you like drama
 
CTRL+H [T_PAAMAYIM_NEKUDOTAYIM] -> [T_DOUBLE_COLON]
Muahahaha
 
@bwoebi I feel like rule of thumb does not apply in this case ^^
 
@NikiC I feel like we shouldn't add too many exceptions to that rule of thumb :-P
 
@HaskellCamargo - you monster, something T_PAAMAYIM_NEKUDOTAYIM is there for historical reasons
 
6:52 PM
Are you brazilian, @marcio?
 
@HaskellCamargo yup
hey you too
 
Yeap. :v
 
legal :>
 
You are one of the first people who I know in Brazil that truly understand compilers, yay.
 
7:01 PM
It's just that there are many people that are not very acquainted to contribute to FOOS
 
I agree, that Brazilian.
Every human does that.
That's why I don't talk to humans.
 
what I most hate about not being home is the lack of acceptable connection speed
I am forced to watch youtube on my 4G because turning on torrent client fills up most of the available connections
and I suspect that same goes for the bandwidth
 
At least there 4G works.
 
well .. there is that
 
Here we can't even use 3G without TIM saying us the we reached the navigation limit.
 
7:11 PM
/me has uncapped 4G
and this house still is using well for water supply
 
In what state do you live, @marcio?
 
Brazil has states?
 
Yeap, we do.
 
/me is abysmally ignorant about south america
 
woot?
 
7:14 PM
I live in Santa Catarina.
 
I live in Sergipe
 
São Paulo, hoar, we are invading the room
@tereško any country the size of a continent will need states
 
counter-example: Russia
 
Do you work with compilers, @marcio?
 
@HaskellCamargo not exactly, I contribute here just for fun
 
7:17 PM
Yay, I also do it for LiveScript and Mermaid.
 
@tereško I'm totally ignorant about Russia :D
 
can you guys recommend a good english youtube news channel that is focused on south america ?
 
In brazil we don't say "you beat it!", we say "Miga, a senhora é destruidora mesmo, hein" and I think it is beautiful.
 
I don't like being ignorant
 
disclaimer ^ don't trust google translator
btw, let's keep the room on topic guys :P
@tereško I doubt there will be any channel with subtitles
 
7:24 PM
I'm also translator in projects, such as phpMyAdmin, Bitbucket, CakePHP, WPS Office and Mozilla Foundation technical articles.

Free software <3
 
I tried to contribute to PHP docs translation but the online editor sucks and the patches are sent through the mailing list... that was a turn off - the guys are really organized though.
 
@marcio you don't have a php.net account then?
 
no
 
okay, then I understand
 
My main work with PHP is writing libraries to hack the core and try to fix design issues.
@marcio, do you know Quildreen Motta or Paulo Torrens also?
They are the unique brazilians I know who works with compilers too.
 
7:29 PM
@HaskellCamargo will you keep up with the preprocessing idea? I think it's promising.
 
Ah, I'll, for sure.
It will be easier than rewriting an entire language.
I'll try to port the Clipper preprocessor, which is per se very powerful.
I wrote this with the preprocessor: prelude.readthedocs.org
 
oh so that's the preprocessor you're using, I could understand the code you shared earlier but had no idea the preprocessor was yours
 
The processor isn't mine, It is written by my friend, but I work with that language and added some features in it that might be implemented in AdvPL compiler.
But my main project yet is Rawr, by a better type system.
 
cool, I have to leave the room now, but you better give us updates about that preprocessor idea using the stream wrapper :P it could even be just a composer package
 
That's nice! See you!
 
7:59 PM
why Hello1
 
8:34 PM
@tereško nah, it is actually an example why such a big country needs states
 
:)
 
Anonymous
8:53 PM
anyone willing to review something for me?
 
Anonymous
except @tereško :P
 
awwwe no love for @tereško :(
 
I am watching Smallville, I would review even if you asked
 
Sounds like a small place.
 
Anonymous
s/would/wouldn't
 
8:55 PM
@samaYo I'm bored and have 30 seconds to spare... Go!
Looks like your time is up. Sorry.
 
Anonymous
uno mas?
 
One more second? Sure.
 
Anonymous
just trying to make this piece of crap github.com/samayo/bulletproof less crapy so, I made this github.com/samayo/bulletproof/tree/dev don't review the class, but the api only. Just check how easy it is to use
 
Anonymous
like I said, don't review the class.
 
Anonymous
How much more easier / simple can / should it be
 
8:58 PM
Ouch, you're using MAX_FILE_SIZE in the form, really?
 
Anonymous
That's just a sample
 
Anonymous
I don't depend on that
 
Anonymous
I know it call be modified.
 
Well, as far as easy goes you have to think about your target audience. For example, how useful is this for someone on AWS where they only have an EBS-based storage and can't save the file locally.
 
Anonymous
ebs? This is for uploading an image with security.
 
Anonymous
9:00 PM
no need to go further and invent something
 
Anonymous
@Sherif If you wanted to make it, how would the API look like?
 
@samaYo Nothing in this code really screams "secure" to me. It's a nice abstraction, but I don't find it to be very useful.
 
Anonymous
please @Sherif regale me as to what you deem to be secure then?
 
Anonymous
aside from copying the image user's pc and pasting it to your server using a usb?
 
Anonymous
also w/o https and reading the image header
 
9:08 PM
@samaYo you should wire up that thing to scrutinizer
 
@samaYo Well, security is all about understanding how someone might abuse your system to get it to do what you never intended for it to do. So let me ask you this... what about this code takes into consideration how an attacker might think. To put it another way, what about your code does something more securely than what PHP already does for you?
 
.. you it will be a bitch to make it work
 
You can't claim security and offer nothing of advantage over PHP's existing security.
 
Anonymous
@tereško bingo!! already tried it once, damn .. It had like only 30-40 quality, I said screw this..
 
@marcio corrected your name btw^^
(class works too now)
 
9:11 PM
And creating a directory without execute bit? Really?
How did you ever expect that to go over?
 
Anonymous
are you using your own linux distro?
 
Anonymous
fyi 666 permission is implied, it can be overriden
 
Anonymous
damn just realized I commited composer.phar :/ newbie
 
@samaYo My point is that your default permissions are useless unix.stackexchange.com/questions/21251/…
Who creates a directory they can't open?
 
Anonymous
I am a linux noob, but 666 is drw-rw-rw which means you can write in it.
 
9:16 PM
Have you actually tried it?
I think you will be very shocked if you actually tried using your own code to do this.
 
Anonymous
YES
 
Anonymous
@tereško help here pls
 
And how'd that work out for you? You created a directory you can't access. How useful is that for a script that will try to run file_exists on said directory?
 
wat
you are trying to install composer ?
 
Anonymous
nope
 
9:18 PM
I'm not really paying a lot of attention here
 
You also committed composer.lock which tells you you're still in the habit of using git add -a
 
Anonymous
he is saying chmoding a folder to 666 does not allow files to be written inside it @tereško
 
No, that's not what I said at all.
 
Anonymous
I give up
 
You seem like the type of person that asks for advice just so that you can argue pointlessly.
 
Anonymous
9:22 PM
never mind, let's just leave it as is.
 
Hey I'm trying to pull some data from a database and I'm getting an Undefined index error
 
I'm tell you that you can't access a directory without execute permissions on a *NIX system. You are using functions such as file_exists, which will need such permissions in order to work. So change your default mkdir permissions to a sane value like 0777 or 0755 instead of 0666, which makes no sense for a directory.
Why spend 20 minutes of your time ignoring valuable advice that you asked for in the first place rather than just make that simple change and improve the usability of your code (something you asked for in the first place)?
 
I have everything matching what the tables in the db are
 
Just seems like a huge waste of everyone's time.
@bseekinsDEV Code?
 
<?php
try{
$sql = 'SELECT * FROM settings ORDER BY id';
$statement = $pdo->prepare($sql);
$statement->bindValue(':id', 'id');
$statement->execute();
$result = $pdo->query($sql);
}catch(PDOException $e){
echo "There was an error getting settings data from the database" . "<br />" . $e->getMessage();
exit();
}
$result = $statement->fetchAll();
foreach($result as $row){
$siteTitle = $row['siteTitle'];
$baseURL = $row['baseURL'];
$static = $row['static'];
$copyright = $row['copyright'];
}
?>
looks right I can't seem to figure out what I have done wrong hmm
 
9:26 PM
@bseekinsDEV That code is a little quirky. You prepare a statement with no parameters, bind a non-existnig parameter to it, and then you run the same SQL query.
 
well the $pdo is in the database connection file
<?php
// pdo database connection
try{
// connects using mysql connection information
$pdo = new PDO('mysql:host=localhost;dbname=final', 'root', '');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->exec('SET NAMES "utf8"');
// if connection fails
}catch(PDOException $e){
// error message
$error = "There was a problem connecting to your database. Please check database configuration" . "<br />" . $e->getMessage();
echo $error;
// exit after fail connection
exit();
}
?>
 
That doesn't change what I said.
 
haha no I know what I did wrong
:D
 
In any case, that statement should not have executed if that was indeed the code you used.
 
see where the dbname=final it was supposed to be todo haha it works now
 
9:28 PM
I see.
 
yeah it was calling the wrong database so it wasn't able to find siteTitle
 
@bseekinsDEV FWIF, the correct way to set the charactset with PDO (assuming you're using MySQL here) is to set it in the DSN and not using SET NAMES
 
Anonymous
6
A: Is setting the uploads folder 777 permission secure?

Gabriel HurleyIn general 777 is about as insecure as it gets... that means anybody can read and write to your files. HTTP PUT isn't inherently any more secure than HTTP POST if you're allowing the uploaded files to be exceuted on your server. Overall, if you are allowing arbitrary files to be executed you ne...

 
Unless you're using PHP < 5.3.6 you should be using new PDO('mysql:host=localhost;dbname=final;charset=utf8', 'root', '');
 
I'm using PHP Version 5.5.12
 
9:33 PM
Great, then you should be setting your charset in the DSN as it will more likely result in the correct client characterset negotiation.
 
ok let me give that a try
 
Especially if you're using native prepares, which it looks like you are ;)
 
this better?
<?php
// pdo database connection
try{
// connects using mysql connection information
$pdo = new PDO('mysql:host=localhost;dbname=todo;charset=utf8', 'root', '');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// if connection fails
}catch(PDOException $e){
// error message
$error = "There was a problem connecting to your database. Please check database configuration" . "<br />" . $e->getMessage();
echo $error;
// exit after fail connection
exit();
}
?>
 
@samaYo First of all, file permissions set to 777 and directory permissions set to 0777 are two very different things. Without the execute bit on a directory you can NOT access any of the files inside of said directory. This means you can't list the files in the directory (i.e. a calling a function like file_exists on that directory will fail).
 
nyone have an idea on how to create a database when if you're trying to create one it says the table doesn't exist?
 
9:37 PM
@samaYo Please stop arguing nonsense and then digging up nonsensical answers on SO to prove to me that you are still very nonsensical. You have already proven that to me 30 minutes ago.
 
Thank you @Sherif for the help/advice
 
@bseekinsDEV Sure, no problem.
 
Anonymous
@Sherif thanks for your time
 
Now that I got that issue out of the way I can start making my pages.
 
Making page not pagefaults...
 
9:40 PM
you always can
 
@php_purest Create a database or create a table?
 
database
 
@bwoebi string.c changes intentional?
 
Creating a database is going to be specific to your DBMS, most likely. For example in MySQL you would do something like CREATE DATABASE newdbname
 
windows restored the computer, and thought "I don't need it, I can delete it"
 
9:41 PM
Seemed a bit unrelated in that commit
 
@php_purest huh?
 
i have it showing as created, but i can't alter the table
 
You likely don't have permissions. Check your DBMS errors when you're running the ALTER TABLE query.
It should tell you whether or not its a permissions error.
 
i'm root
 
So.
 
9:44 PM
@NikiC uh, what… let me recheck what I committed…
 
You could have screwed up root's permissions if all I know.
 
#1146 - Table 'database.tble' doesn't exist
 
@NikiC naaaaah
That was a test to try perf difference
 
OK well that error is clearly telling you that table doesn't exist.
You can't alter a table that doesn't exist.
Did you even bother selecting the database before attempting to alter that table?
 
i can't do it when creating one also
 
9:46 PM
@NikiC that shouldn't be committed -.-
 
start a new database?
 
Sure, because that will obviously help you resolve the problem of altering a non-existent table in the current database.
Use SHOW TABLES to see what tables are in that database.
 
when it shows one exists
 
@NikiC will look at it… it's fine but needs some improvement when printing ints…
 
I can't seem to run PHP. I compiled it and it compiled fine. But doing something as simple as php -v gives error Segmentation fault.
 
9:50 PM
Clearly it didn't compile it fine :)
 
show databases?
all exist
odd
start the database from scratch it obviouslt hates me ATM
if only phpmyadmin had a backup in a folder option
what does the triangle in phpmyadmin that looks like a caution symbol mean?
 
I'm going to take a wild guess and say ... caution?
 
10:08 PM
@crypticツ What do you get if you run php -v?
 
@bwoebi Also ext/tokenizer/tests/token_get_all_TOKEN_PARSE_001.phpt fails
 
@NikiC yeah, I saw on travis
going to fix that
@NikiC disable-all builds disable too much :-D
 
@crypticツ Oh... wow... I can't read.
If you haven't already, remove all extensions from php.ini and see if it works then.
 
10:30 PM
@Trowski rather suggest php -nv which exempts ini instead of changing ini…
 
same error
compiling with a list of extensions disabled, will try to narrow it down. I typically compile extensions into PHP opposed to a shared extension.
 
@crypticツ have you tried valgrind?
just install it through apt/yum and then do valgrind /usr/bin/php -v
Or whatever the path to php is for you.
 
pastebin.com/NtX3ahJk have no idea what it means.
 
morning
 
@crypticツ It says something is broken....what version of php are you compiling?
 
10:40 PM
@Danack git master
 
@crypticツ is this a fresh clone?
 
not cloning just getting the archive from github.
So it is latest, and compile directory is wiped during each compile.
 
@crypticツ I'd suggest trying a commit from a few hours ago - there's a chance something may have broken today...
 
now it's working, it's one of the extensions enabled. Will keep narrowing it down.
 

« first day (1682 days earlier)      last day (3266 days later) »