« first day (2039 days earlier)      last day (2925 days later) » 

10:00 PM
@NikiC that only makes a difference for nested functions and methods though, right? at the top level I would imagine function foo() { global $foo; } and function foo() use(&$foo) {} would act the same, I hope?
apt-get install php5-cli certainly will not install php7. — Alexander O'Mara Apr 1 at 22:54
new favourite StackOverflow comment
 
@Andrea If it's a legacy code-base, yes
If it's a modern codebase, no, because pseudo-main scope will be the scope of the autoloader function / method
 
@NikiC Oh, right.
The print_r function is rather unhelpful, it outputs nothing for FALSE or NULL, and 1 for TRUE. I would suggest using var_dump instead. — Andrea 37 secs ago
Why do we still have print_r. Why.
It's the worst of our variable printers. PHP being PHP, it has to have multiple ones.
var_dump, print_r, var_export, debug_zval_dump. Are there others?
 
@Andrea print_r is much more pleasant and less wasteful in terms of vertical space. If var_dump looked more like print_r, but still gave the type info and literal values for things that could be considered false, as well as quotes around strings for seeing empty strings, etc, that'd be nice. Essentially, if you really need to know what's going on, var_dump all day, but print_r is soooo much more visually appealing.
 
> If you refer to the ML history, you will see that a lot of people, if not most, consider it as the most serious PHP sadness overall. So, what I'm exploring here is the lowest price to pay to get rid of this issue.
 
That and the only way to capture var_dump output is using output buffering, while print_r has that handy second parameter (which var_dump cannot for obvious reasons, it'd probably need a second named function call)
 
10:09 PM
@Dereleased write your own variable dumper ;)
 
The lowest prices is to tell those people to "go forth and multiply".
 
@Andrea Done long ago, but I don't carry everything I've ever written from job to job, or even project to project.
 
@Dereleased ah, yeah :/
 
@Andrea Also, var_export allows you to write some truly terrifying things =)
 
@Dereleased useful for caching!
 
10:18 PM
user image
2
 
10:31 PM
@Andrea That is one of the less terrifying applications, yes. I've been places. I've seen things.
 
@Sara why thank you!
 
10:43 PM
@NikiC I just found 5 syntax errors in third party code that has been sitting in our repository for years because I ran it through your parser.
These are old, not maintained upstream dependencies unfortunately.
I wish static analysis, even if it is just php -l, was standard since PHP's inception ^_^
(Also, these are not things that changed; these errors would have always been errors)
 
user895378
11:14 PM
@kelunik much better, in that case
 
user895378
@kelunik I don't think we should limit it to "exactly one" ... because after all ... we don't know what we don't know. Always makes sense to keep future options open.
 
user895378
"Open to extension, closed for modification"
 

« first day (2039 days earlier)      last day (2925 days later) »