« first day (1623 days earlier)      last day (3330 days later) » 

4:00 PM
@Danack Bah, those people with auto-complete unfriendly names
 
@NikiC I think the problem is that the 'constructor' functions are also used by the factory create methods - NumberFormatter::create() which still needs to return null. Can you point me to a concrete example you think is wrong?
It probably will be wrong.....but I don't think all of them will be.
 
@Danack those will return null by just writing return;
the CTOR_MAKE_NULL thingy is magic to make it work for ctors, as they don't have a return value as such
 
4:14 PM
@NikiC Fair enough, that does look like it's been missed. The exception generation is buried inside the intl_error_set_ex() function. Rather than change lots of things the patch just forces an exception when an error is reported inside a constructor - which eventually reaches - github.com/Danack/php-src/blob/InternalClassClean/ext/intl/…
 
happy fryday!
 
@NikiC running into an issue with your parser generator
it's not quoting array keys:
$this->semValue = new Node\Stmt\If_($this->semStack[$this->stackPos-(5-2)], [stmts: is_array($this->semStack[$this->stackPos-(5-3)]) ? $this->semStack[$this->stackPos-(5-3)] : array($this->semStack[$this->stackPos-(5-3)]), elseifs: $this->semStack[$this->stackPos-(5-4)], else: $this->semStack[$this->stackPos-(5-5)]], $attributes);
 
@NikiC I'm not quite sure why it's even being checked.
It should check that A says it satisfies IteratorAggregate. Whether it really satisfies it should be left to the declaration of A.
(With interfaces there are no issues, since they are always done at runtime unlike concrete class inheritance)
 
@ircmaxell how are you using it?
 
php rebuldParser.php
?
 
4:19 PM
that should usually take care of it
though honestly that particular replacement is not worthwhile anymore, I'd say
 
what do you mean?
 
@NikiC Yours sucks because we have a few different nikita's around now. niki + tab doesn't work. I have to write your full name.
 
@ircmaxell are you running the script on the file as it is now or after modifications?
@ircmaxell I mean that it would be better to just write out the array in the file, instead of doing that magic replace. iirc that's a leftover from the time when everything was specified as arrays and using verbose array syntax was a bit of a pita
 
@LeviMorrison it's the same number of keystrokes :-P
 
@NikiC after modifications
generics:
	  /* empty */											{ $$ = null; }
	| '<' '>'												{ $$ = null; }
	| '<' non_empty_generic_types '>'						{ $$ = $2; }
;
 
4:26 PM
That's all?
 
no
 
I'd have suspected unbalanced parentheses
 
changed a bunch of declarations
class_declaration_statement:
      class_entry_type T_STRING generics extends_from implements_list '{' class_statement_list '}'
          { $$ = Stmt\Class_[$2, [type: $1, extends: $4, implements: $5, stmts: $6], [generics: $3]]; }
    | T_INTERFACE T_STRING generics interface_extends_list '{' class_statement_list '}'
          { $$ = Stmt\Interface_[$2, [extends: $4, stmts: $6], [generics: $3]]; }
    | T_TRAIT T_STRING generics '{' class_statement_list '}'
          { $$ = Stmt\Trait_[$2, $5, [generics: $3]]; }
 
@Danack you broke the PHP docs build!
 
@NikiC good call, that led me to find it! thanks :-D
 
4:28 PM
@ircmaxell and functions?
 
shit......but I used the online editor.....and validated all the xml....
 
@marcio yes
 
cool
 
@ircmaxell where was it? Don't see it in your pasted code
 
@salathe hehehehe
 
4:29 PM
@Danack you just had a <method>...</method> which should have been <methodname>...</methodname>
 
2 hours ago, by Danack
Also, I hate computers.
 
@NikiC I changed a bunch of places, it was in a random one...
 
@salathe Is there any way to test the build via the online editor?
Or can it only be done offline?
 
@Danack commit and check whether the build fails :P
 
BTW, why do we use $1, $2, $3 in bison? it's hard to maintain sometimes :3
 
4:33 PM
@DaveRandom Sure, but I used to be able to get away with nik + tab.
 
now, to build support for transpilation :-D
 
@LeviMorrison use [tab] [tab] and when you get the right one go with [space]
 
@marcio That's more work than just typing nikic :)
 
@LeviMorrison nikic is the first option, so you only press [tab][space] (same effort)
 
user895378
@therealnikic
 
4:37 PM
unless you always feel tempted to use [return]
 
Can someone help me, I have just set up nginx for the first time and I am receiving a 404 Not Found when trying to visit css/js files? and also txt files...
 
make sure all the directories down to your static folder have the +x flag
 
I only just started using nginx, Can you be a bit more noob friendly? I added the folowing code still no luck.
location ~ \.css {
add_header Content-Type text/css;
}
location ~ \.js {
add_header Content-Type application/x-javascript;
}

location ~* \.(css|js|gif|jpe?g|png)$ {
expires 168h;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
 
@marcio I use return and I don't even know what that does.
NikiC is the first result but it chooses nikita2206 when use it.
 
Seriously, how does this count as a room? I've seen bigger cupboards.
 
4:49 PM
lol, first world problems :D for me steps are:

1. type '@n'
2. [tab]
3. [space]

Done.
 
@Fabor in France, it has to be 9m2 to be considered a room
 
@Fabor looks fine for me =]
 
Ronni I didn't know you were part hobbit -_-
 
@Fabor four walls and a door (it even has windows :))
 
Windows? Luxury!
 
4:54 PM
@Fabor =] I can live like one
/me pours a drink
 
Can anyone help me with nginx? I have added this script but CSS files and images still don't load!!! I also get 404 not found when I try to visit a VALID css path
location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
            expires 30d;
            # Optional: Don't log access to assets
            access_log off;
    }
 
user895378
It's got windows and a door. It's not a fire-trap, at least :)
 
Can someone help me please?
 
@LiamHardy did you read the whole of the page I linked?
 
posted on March 27, 2015 by kbironneau

/* by Esteban */

 
5:05 PM
You never linked any way...
any page*
I must of been afk if you did.
@Danack that is an old issue.
I now can't load any css or js files.
 
1 hour ago, by Danack
@LiamHardy Maybe compare your configuration against this one - http://blog.basereality.com/blog/11/ ?
 
Like I said, that is an old issue.
I have fixed that now.
 
I still suggest that looking at a correct conf file might help you solve almost any error with an invalid configuration.
 
I have been searching through config files for 3 hours solid now, and to be honest it's getting quite annoying.
 
But in particular:
#enable rewrite log which spams the error log.
rewrite_log on;
may be of assistance in figuring out the error.
 
5:14 PM
2015/03/27 10:13:40 [error] 3868#3840: *1 CreateFile() "C:\nginx/html/themes/default/css/all.css" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: localhost, request: "GET /themes/default/css/all.css HTTP/1.1", host: "127.0.0.1", referrer: "http://127.0.0.1/index"
It seems to be using the old folder 'html' that I changed once, to another folder
 
Have you tried turning it off and on again?
 
Thousands of times.
I only changed the location in the php function though
is it defined somewhere else aswell?
I only changed it in here, is it defined somewhere else for the css?
location ~ .php$ {
root php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME C:/Dropbox/Website/$fastcgi_script_name;

include fastcgi_params;
}
 
> root php;
What is that meant to be doing?
It looks very much like Nginx thinks the root is 'C:\nginx' rather than the directory the website is in.
 
@Danack you don't need to remove the ctor_make_null mechanism (someone else will take care of that afterwards), just drop the macro calls ;)
 
5:37 PM
@ircmaxell If you need help on the generics project ... I have nothing better to do
And that sounds like a fun project ... maybe ^^
 
@NullPoiиteя about that canonical basic php json decoding question: I'm taking feedback on gist.github.com/pcrov/01953d75917874ff4351 - aiming to put it up soonish.
 
@NikiC yeah, I'm like 50% of the way through a proof-of-concept. Once I get it running I'll show you the code and then you can run with it :-D
 
also if anyone else wants to have a look ^^ - I'm uneasy trying to explain things to absolute beginners... never really know what's too much or too little
 
trait NoDynamicProperties {
    public function __get($name) {
        $this->throwDynamicPropertyError($name);
    }
    public function __set($name, $value) {
        $this->throwDynamicPropertyError($name);
    }
    private function throwDynamicPropertyError(string $name) {
        throw new RuntimeException("Property \"$name\" does not exist");
    }
}
Since this morning, I'm including this trait in all classes
Thanks @rdlowrey for the idea, it's priceless
Also: Finally found a good use case for traits ^^
 
:-)
 
5:44 PM
We could have a declare(no_dynamic_properties=1) !
 
COUGH
Nov 5 '13 at 16:15, by Danack
@rdlowrey A valid use for traits:
 
'13 - hipster
 
Okay, credit goea to @Danack rather than @rdlowrey then ^^
 
/flex
 
@nikita2206 Actually, I think that we might want to consider adding a "strict mode"
Which does strict types and much more :)
 
5:46 PM
Not sure if you are joking but that's a good idea I think
 
Nope, not joking
Should be one mode though, as opposed to a bunch of individual settings
 
yeah, what would that mode contain though?
 
Don't want to have declare(strict_types=1, no_dynamic_properties=1, moar_stuff=1, ...); at the top of every script
@ircmaxell That's something we should discuss for 7.1 :) disallowing dynamic props is one, elevating a bunch of errors (like undef var access) another, but I'm sure there's much more stuff one would want to do
 
@NikiC s/7.1/8/
 
@ircmaxell it's bc tho
 
5:49 PM
Like disallowing var $property; declarations
 
true, but I'd see this as a big enough feature...
 
and testing stuff in a strict mode in 7.1 might give us insight into stuff that could be dropped altogether in 8.0 - maybe, dunno
 
yeah, that's a good point
no superglobals in strict mode
 
No global $shit;
 
no implicit casting ($a = "12"; $a + 1; <-- error
 
5:51 PM
@NikiC that's one of the reasons I was suggesting declare(strict=1) instead of strict_types but people said they prefer to have declare(something=1, otherSomething=1)
 
No contries
nothing to kill or die for
and no religion too
 
and no tabs
 
@marcio once you did declare(strict=1), adding anything to it becomes a bc break ;-)
@nikita2206 it's easy if you try
 
@NikiC so, to set dynamic properties I now need Reflection on your classes? ^^
 
@ircmaxell oh right, now that the door is open a strict that sum things sounds good
 
5:52 PM
@ircmaxell we can do evolution ... declare(strict=1) ... declare(pedantic=1) ... declare(anal=1)
5
@bwoebi nope, still a per-file switch
 
can we have strict arg counts on strict so we can break zend framework "interfaces"? :3
 
@bwoebi it would be the same as with STH
 
declare(masochistic=1)
 
masochistic mode requires you to manually patch composer.phar
 
♫ imagine all the people... indenting with space - Ah ah-ah-aa-a ♫
 
5:56 PM
@bwoebi oh, with that yes
 
@PaulCrovella answer is really nice but i have little doubt about question ,
 
@PaulCrovella you now must record a cover of that song, with the new lyrics
 
@NullPoiиteя Same. Not entirely sure what to put for it. Would love any suggestions.
 
@PaulCrovella i am really bad at asking question ;) but little example of code in question maybe
 
I just imagined template traits inside a template class extending another template with __get __set and __call implemented
 
6:09 PM
Not sure if PHP needs a strict mode
I mean, certain types of errors can be caught by a compiler/linter/whatever
 
@NullPoiиteя I'm not sure what code to add, but will think on it more. Give it a refresh, does just adding the json to the question help?
I've seen people complain about things like minor differences in array structure between questions on flagged dups, so I don't know if adding detail to a target question will do more harm than good.
 
6:24 PM
imho it will be a little better ,
but couple of people here know how to write good post , ( almost all frequent users )
 
6:41 PM
evening
 
7:09 PM
it works :-D
 
:D
 
nice
 
are you're doing it just with expansions?
 
@ircmaxell cool
 
man, I can't wait to see people lose their minds over that
 
7:11 PM
this is built with pure php :-D
 
what happens if you instantiate 'new Item<StdClass>(new \StdClass)' twice?
(assuming you are generating the classes on the fly)
 
it re-uses the instance
 
the instance or the class?
 
new Item<StdClass> gets compiled to $item = new \test\Item\_①_StdClass_①_(new \StdClass());
2
 
ahh :D
 
7:18 PM
clever shit ...
 
@ircmaxell now you only need begin work on PVM , PDK and PRE
 
That was funny. Reminds me of the epic SO code comment thread
 
7:39 PM
0
Q: How do I extract data from JSON with PHP?

Paul Crovella This is intended to be a reference question and answer covering a large number of the never-ending "How do I access data in my JSON?" questions. It is an introduction of the absolute basics of decoding JSON in PHP and accessing the results. Please close any question that is not significan...

@NullPoiиteя @PeeHaa ^ posted
 
Nice
 
7:54 PM
Hey, guys, can you help me today? :D I have stupid eval method in PHP, but it does not work :-/
code:
$x = "0";
$y = "0";
$evalx = eval("return $x*30"); // should got zero, but nope, the error instead :D
$evaly = eval("return $y*30");
error: Parse error: syntax error, unexpected $end in /3w/wz.cz/r/rbg/mp-test/game.php(71) : eval()'d code on line 1
 
8:05 PM
i) You almost certainly don't want to use eval here ii) Try just running return $x*30 and see what happens.
 
Yeah! Thanks, @Danack! One question: why my eval didn't work?
 
@PDKnight My bet is that you can't eval("return") and have it work the same way as return
eval is a necessary evil at best
 
but "$x*30", '$x*30' and other variations didn't work, too
 
man, haters came out of the woodwork on that one. fuck me for helping.
 
8:20 PM
@PDKnight semi-colons
 
so what is the best way to eval (for example) "2+2*6" in PHP?
 
$x = 2 + 2 * 6;
;)
 
really? how stupid I am xD
thanks, mate
 
General rule of thumb: If you need eval, you've probably not thought the problem through enough
 
or are you actually trying to parse arithmetic from a string?
 
8:24 PM
@Leigh true
but it works too with string :)
 
So can we do a reverse cv for Paul's thread? stackoverflow.com/review/close/7495146?filter-tags=php Not sure how many disagrees it needs to stay open
 
Might be worth to prove the usefulnes of the question by linking a few duplicates that can be closed against the new one. ~ However, I'm convinced that this chat excpert would then end up on meta ~
 
annd closed
I give up. g'night.
 
Yeah, I know. Is why I asked. But if it's considered OK to ask for closes in chat, it follows you can ask for reviews as well, right?
Well, I voted for reopen FWIW. Have a good weekend folks
 
8:57 PM
namespace test;

class ItemList<T> {
	protected $items = [];
	public function addItem(Item<T> $item) {
		$this->items[] = $item;
	}
	public function getIndex($idx) {
		return $this->items[$idx]->getItem();
	}
}
becomes
namespace test;

class ItemList
{
    protected $items = array();
    public function addItem(\test\Item $item)
    {
        $this->items[] = $item;
    }
    public function getIndex($idx)
    {
        return $this->items[$idx]->getItem();
    }
}
however, when you call new ItemList<StdClass>, you get:
namespace test\ItemList;

class _①_StdClass_①_
{
    protected $items = array();
    public function addItem(\test\Item\_①_StdClass_①_ $item)
    {
        $this->items[] = $item;
    }
    public function getIndex($idx)
    {
        return $this->items[$idx]->getItem();
    }
}
 
@ircmaxell shouldn't the addItem typehint be just stdClass?
 
no
because it was declared as Item<T>
where T was parameterized by the ItemList
 
oh sorry, didn't read closely enough
 
interhitance doesn't work
at all
 
9:13 PM
$autoloader = require __DIR__ . "/../vendor/autoload.php";
$new_autoloader = new PhpGenerics\Autoloader($autoloader);
$autoloader->unregister();
$new_autoloader->register(true);

foreach (get_declared_classes() as $class) {
	if (strpos($class, "ComposerAutoloaderInit") === 0) {
		$r = new ReflectionProperty($class, "loader");
		$r->setAccessible(true);
		$r->setValue($new_autoloader);
	}
}
 
9:44 PM
is that some test?
 
OIS
10:07 PM
lo
Ill make a class called ComposerAutoloaderInitHah
 
@ircmaxell nice
 
user895378
10:26 PM
@NikiC It's super helpful, right? Also, I was also thinking about converting that to a trait as well. Inheritance limits it somewhat and increasingly I find it useful for implementing that protection in all of my classes. If nothing else it helps me when I constantly change the names of internal properties.
 
user895378
@Danack Woah I totally didn't internalize that at the time. Nice job :)
 
@NikiC Question.
Why is that an invalid context?
With inner classes and nested classes that could be used to disambiguate.
(function a should be returning $this->b but it doesn't get that far so I didn't notice)
 
@LeviMorrison It thinks it's a constructor?
 
LMAO
You might be right.
 
user895378
hehehehe
 
10:33 PM
I should write an RFC to remove this feature.
 
user895378
That would be funny.
 
Ofuck I am right: 3v4l.org/0ZZ09
 
(Well, it claims it doesn't have access to the private which is just incorrect, but hopefully you get the point -- it works with publics)
@rdlowrey Correct.
2 messages moved to Trash
1 message moved to Trash
Okay, try number 3:
Why does :: allow calls to non-static methods, but not to non-static properties? (See 3v4l.org/OY2EX and 3v4l.org/EEJBu)
 
Because PHP. Apparently it's because people wrote a significant amount of 'OOP' code that access methods both statically and through $this. Instead of breaking the code, both calls were allowed.
NikiC is fixing this.
Isn't he?
 
@NikiC I think :: should work for non-static properties because it works for non-static methods.
This actually would be useful if we had nested classes, because you can use it to disambiguate inside of the inner class if you there is a conflicting property.
 class Outside {
     private $private = 13;
     class Inner {
         private $private = 42;
         public function getPrivateOfOutside() {
             return Outside::$private;
         }
     }
 }
 
10:47 PM
@ircmaxell noice :) did you happen to change your editor in the middle of writing this?
@rdlowrey Totally. Especially if you don't happen to be using an IDE just then, having this trait on all your classes saves you a bunch of debugging time
@LeviMorrison I think we should be happy that at least for properties static/non-static scopes are relatively separated and not mess with that
For accessing the outside object I would propose using Outside::$this->private, which seems more obvious to me and also happens to match Java and D
 
Except we already have :: scoping for methods.
 
Yes, which is quite confusing and we don't want to add to that
Using the same syntax for a static access and a scoped access is a bad idea
 
I would much rather add that than Outside::$this->private.
Especially since we already do it on methods.
Anyway, I think it's bad that :: isn't consistent.
I don't know if we can or even want to remove the non-static method calls.
That would then mean to reach consistency (and would actually be useful in certain features) we'd need to support non-static properties.
 
I don't think we can drop it in general
Might restrict it to parent:: only though, like in Java
I would venture that for the vast majority of PHP developers Foo::bar() is a static call and parent::bar() an exception to that rule ^^
 
Perhaps.
 
11:00 PM
And the fine details of scoped instance calls are quite typically lost
 
I still think Outside::$private is better than Outside::$this->private.
 
Which is imho okay, as doing that (apart from the parent case) is likely a bad idea anyway
@LeviMorrison If you say so.
 
I could be wrong :)
 
I refuse to acknowledge that dreadful possibility :P
 
11:05 PM
@NikiC yes, switched from vim to sublime :-P
@NikiC I've seen large codebases that didn't rely on that
 
Anonymous
Does anyone know a good alternative to gitlab?
 
@ircmaxell I've seen PEAR as well :P
 
will the exception RFC by @SebastianBergmann be voted for PHP7?
 
It needs to be.
 
Yes, it will (unless we accept by consensus). Still needs a separate thread and a patch
 
11:15 PM
ok, I thought it was forgotten in the middle of the STH nuclear incident
 
user895378
@NikiC The other thing I've been using __set() and __get() for is exposing maximally performant property APIs in my server. Because there's always a server-wide debug setting passed around I instantiate debug structs and use __set() __get() to access/modify properties. Then in production mode I instantiate child objects extending the "safe" parents and expose the same properties as public.
 
user895378
So for example you always access request things through the property API like $request->method and if you're doing something wrong like trying to modify the "readonly" property it will throw an error in debug mode.
 
user895378
But in production mode it avoids tons of fcall overhead for things that are actually properties without worrying about safety.
 
@NikiC Well… @LeviMorrison is totally right in that case...
 
@rdlowrey "I have that weird bug here, but in production it works fine." ;-P
 
user895378
11:21 PM
@kelunik If you ignore uncaught exceptions that crash your server in debug mode it's your own fault :)
 
I think I should use it again, currently I'm running in production mode locally. Wait, actually, there isn't anything running locally, because I'm in the mid of that refactoring.
 
user895378
@kelunik Well, none of this is upstream and likely won't be for several days. I too am in the middle of major refactoring. So I wouldn't worry about it :)
 
@bwoebi where do you said I should move the t_stream API?
 
@marcio zend_language_scanner.l
 
ok
 
user895378
11:29 PM
wait ... is @marcio working on a streams API thing?
 
noooo
@rdlowrey the token stream
 
posted on March 27, 2015 by hakre

PHP’s Simplexml ships with a lot of magic to simplify access to an XML documents element and attribute node values. Some criticize this and suggest to use the DOM library instead. The DOM library on the other hand, even it … Continue reading →

 
user895378
oh lol okay nevermind
 
@rdlowrey lol, I feel slightly offended (not really, just joking)
 
user895378
hehe, you shouldn't. What are you actually working on right now with parsing stuff?
 
11:32 PM
@bwoebi but, for instance, github.com/php/php-src/pull/1158/… needs to be generated along with the ext tokenizer
@rdlowrey nothing big, it's just one of the numerous attempts to port ext tokenizer effectively without create too much issues ^^
 
@marcio zend_language_scanner.c is anyway an automatically built file … maybe you can tell bash to add that at the end of the file then ;-)
 
ok :)
 
11:50 PM
(just make attention that it works on windows too) @marcio
 
@bwoebi why would it break on windows?
 
@marcio no, that the instructions to append it are executed too
 
^^
 
nik
Architecture question: you know how domain should drive an application right? Kind of a top-down design. Lower level components should depend on higher ones etc.
For example "user registration". User domain object should drive the entire process, objects involved are let's say: userForm (responsible for validation), userService (responsible for persisting) both implementing some sort of interface related to user model.
The question is should User object necessarily be involved in this process? If it is sufficient can userForm and userService just talk to each other directly without a User being some sort of an adapter between them.
 

« first day (1623 days earlier)      last day (3330 days later) »