« first day (1652 days earlier)      last day (3282 days later) » 

12:00 AM
> now that's how you troll, people.
 
@Danack So there is one oop overal , whitout takeing into conseridation fundamental differences between programing languages, i don't want waste anyone's time any more that's a good conslusion for me
 
12:33 AM
@LeviMorrison @Danack i've spent some time formalizing my thoughts about the new php7 exception hierarchy on bugs.php.net bugs.php.net/bug.php?id=69530 take a look at it when you have some time :D
 
/forward @Nikic
 
1:11 AM
@Worf Can you clarify the sentence:
> When one uses a catch(\Exception $e), an alternative implementation is being provided for anything that could have caused an error in the try{} block while in production.
as I don't understand exactly what you mean.
 
as opposed to assert() that is used for debugging @Danack
> When one uses a catch(\Exception $e), an alternative implementation is being provided for anything that could cause an error in the try{} block while in production.
better :P
basically, if you have a catch(Exception) that handles an error condition to provide equal functionality. you don't want AssertionError to get caught by that, because it would hide a failed expectation message, which is supposed instead to go up through the call stack and reach the debugger / logger / whatever's correct catch()
not that java is a good example, but assertion errors are classified as unchecked errors. in dotnet instead failed expectations go directly to the debugger
 
1:34 AM
@Worf Apologies in advance if the next few sentences makes me sound like an arse; I may have been to the pub, and I may not be the most tactful person to begin with.
"an alternative implementation is being provided" sounds really weird to my ears. I think it sounds odd as who is providing the alternative implementation is unspecified, as well just being an odd conjugation of the verb 'to be'. But also you don't provide equal functionality, you instead provide graceful error handling, where an alternative code path can be taken.
aka an alternative set of functionality, where something went wrong, and we can do something else instead.
Other than that, I think I agree with all. I think the Throwable should be an interface; there isn't a strong argument for it to be right now, but it avoids having a hierarchy built up for the future.
 
yeah i could have used better words. that's what i meant. and i suck at english :P i apologize for that
feel free to add comments anyway
 
lol, it okei.
 
lol
Throwable reminds of an interface, i couldn't think of a better name
 
An argument could be made for assertion errors being under Exception, as basically most people will almost certainly be using:
assert($foo);
as shorthand for:
if (!$foo) {
	throw new Exception("foo is falsy");
}
Something something, people who use assertions in production deserve everything they get.
 
Exception should stay the root exception.
That's my stance.
 
1:46 AM
@Worf You should probably just post it to internals (maybe after NikiC responds) - we do need to sort this out...
 
Anyone catching \Exception either wants to catch all exceptions or deserves the unexpected behavior.
 
@LeviMorrison ideally Exception should be the root exception, but then you would end up having unchecked exceptions children of checked ones as in java (ask java users if that makes sense :P)
 
We already have exceptions in LogicException that are probably more suited to RuntimeExceptions
There's no reason to work around out existing hierarchy.
 
@Danack yes it's important before people start writing code on it
 
@LeviMorrison I'm too tired to argue this forcefully - but that would require a new catchable thing that allows for catching all normal exceptions (aka not parse errors, or engine exceptions) so that people can continue to do something like:
try {
    callVendorProvidedLibraryWhichIsRubbish();
}
catch (\Exception $e) {
    throw new VendorException("Error calling vendor function", null, $e);
}
Catching all exceptions to wrap them in a more specific exception is the correct behaviour for that case, I think.
 
1:50 AM
and why do we need a new catchable thing for TypeException or EngineException, hmm?
I don't see how that would require new functionality?
 
basically an automatic rethrow, i guess?
 
@LeviMorrison something something, it totally breaks my use case where I'm calling code that might or might not be valid PHP, if it now suddenly doesn't stop the script from executing.
 
the thing is @LeviMorrison that user code extends Exception, not spl's LogicException
 
Which might not be a totally valid use case for maintaining that behaviour.
 
Hey James.
@LeviMorrison Stop shadowing me.
 
1:55 AM
also spl exceptions are very confusing. i don't understand why there's difference between compile and runtime errors for instance
 
Thanks.
lol
@LeviMorrison You should like this, James: irisemedia.com/blog/wp-content/uploads/2011/05/…
 
ahah
 
@Worf I'm not going to say that drugs are bad, I'm just going to say that some of the SPL was designed when people were discovering Mescaline, and that the results were bad.
2
 
LOL
 
 
5 hours later…
6:41 AM
@Danack I've got this visual of Marcus doing mushrooms and repeatedly muttering iterator iterator iterator iterator iterator iterator iterator iterator iterator iterator iterator iterator iterator iterator iterator iterator iterator iterator in the corner.
 
7:16 AM
@Worf Should go to the internals list
Also, I disagree with calling an exception an "error" in a language that also has a concept of "errors" that are not exceptions
morning @Sara
 
mornin' niki
or, early evening here...
 
consider it a UGT morning :)
 
good (ugt) morning!
 
7:33 AM
I try to do cross site ajax. I use this script http://www.abdulqabiz.com/blog/archives/2007/05/31/php-proxy-script-for-cross-domain-requests/
But I want to enable JSONP that I can do normal ajax from the site. How can I do this?
Or maybe their is another better script that do this?
Thanks
 
Morning
Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain from which the resource originated. A web page may freely embed images, stylesheets, scripts, iframes, videos and some plugin content (such as Adobe Flash) from any other domain. However embedded web fonts and AJAX (XMLHttpRequest) requests have traditionally been limited to accessing the same domain as the parent web page (as per the same-origin security policy). "Cross-domain" AJAX requests are forbidden by default...
 
So I have to add header in the php file?
Access-Control-Allow-Origin:
 
It would look something like:
 
7:49 AM
@PeeHaa Thanks!!!!
 
8:16 AM
morning
 
Morning @tereško
 
8:30 AM
this thing looks pretty interesting: elephone.hk/P7000.html
 
@tereško I cannot read that engrish on that page
 
=P
it's $160 for metal-framed phone with 1440p display, 3GB ram and one of the largest batteries I have seen in past 2 years
but I will probably wait till they release this thing: betanews.com/2015/04/23/…
 
@tereško Yeah the battery capacity indeed looks very interesting
Although my s5 already keeps running for at least 2 days
 
since my z2 keeps acting as "youtube machine", it only lasts one day
 
Yeah that is a serious battery drainer :P
 
8:47 AM
but what else can you do, when you have unlimited 4G
 
using teamviewer is actually doable when the need arises
 
I have different remote app, because it also had a simplified interface for media controls
 
Ah yes. That one looks like it is more easy to use
 
9:05 AM
I was working with arabic characters on php + mysql.
mysql collation is `utf_unicode_ci`
I found these strange garbage stuff, when i stored into database.
and how do i correct these garbage into readable characters
 
340
Q: UTF-8 all the way through

mercutioI'm setting up a new server, and want to support UTF-8 fully in my web application. I have tried in the past on existing servers and always seem to end up having to fall back to ISO-8859-1. Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL and...

 
^
 
i got these, but how do i correct the existing data present in DB and i used charset of utf-8 earlier and will it effect the exisiting data with utf8mb4_*
 
I would just burninate the existing data
 
i am afraid that, it should not destroy the previous data..
oh! seriously.
 
9:11 AM
5
Q: How to convert wrongly encoded data to UTF-8?

BrianI'm working with data from an old mysql database. There's a table in this database with a string column that has its encoding set to "cp1252 West European (latin1)" (same as Windows-1252). When querying the data from mysql command prompt, data from this field is represented as: Obama’s This i...

 
hmm not working..
well, thinking of clearing it off previous data.. and
somebody gonna go crazy haha..
thanks.
 
Anonymous
just save it for later
 
Anonymous
just save it for later
 
Anonymous
just save it for later
 
Anonymous
9:26 AM
just save it for later
 
Anonymous
just save it for later
 
Anonymous
wow didn't see that comming
 
9:41 AM
hi
i have used PHP with Yii framework
 
hey
@RamMansawala I'm sorry for you :P
 
i want to send mail from localhost. is it possible? if yes, how

?
 
Or you on windows or on nix?
 
windows
 
In my wordpress blog adsense is not working
 
9:44 AM
@RamMansawala Use a mail library and look at stackoverflow.com/questions/712392/…
 
On adsense ...it gives blank page when i clicking on it
 
@PeeHaa okay. i see
@PeeHaa Failed to connect to ssl://smtp.gmail.com:465 [SMTP: Failed to connect socket: No connection could be made because the target machine actively refused it. (code: -1, response: )]
i got this error while i run my applicaton
 
10:02 AM
Have you googled the message?
 
not yet
 
@RamMansawala my condolences
in my personal experience it was a terrible .. well .. emmm .. experience
 
morning. are there any examples of php code injection, in php code which makes no database calls or system/exec calls. lets assume everything else is fair game
 
@RobMullins How can there be php code injection with a database?
Unless you are doing something else seriously stupid
 
@RobMullins a simple example is: publicly available upload directory, with no filtering on upload mime-types
 
10:07 AM
maybe im misunderstanding the terms. but for example, unprepared/unfiltered database queries from userinput
 
@RobMullins That does not inject php code by itself
 
@PeeHaa welcome to my rabbit hole: youtube.com/watch?v=rdyQoUNeXSg
actually, that video will be useful to you too @RobMullins
lets reconvene in 45 min :P
 
lmao
thanks for that, here's an example of what i'm trying to look into: (this doesnt work) http://pastebin.com/YHZwbmQc
thanks for pointing out the file upload exploit tho
i was trying to manipulate a simple if statement
 
@RobMullins on older PHP versions there also are things like this: 3v4l.org/SddDJ
 
@RobMullins Also there was register_globals
 
10:18 AM
interesting, this is the scope im trying to look into. in the if statement example, is it not exploitable because the input is bounded by quotes?
 
@RobMullins You just have a string
Might as well say $a = 'foo';
 
anyone know how to send mail from localhost. i am using php with Yii framework.
 
do you have smtp configured on the localhost?
thanks @peehaa, i see that now. im currently reading owasp.org/index.php/Format_string_attack where print statements are exploited in C
 
Hello everybody!
 
@RobMullins no. i dont know how to configured smtp on localhost
configure*
 
10:29 AM
I can't remove my php from Ubuntu, php -v always works :D
 
@RobMullins i got this error
SMTP -> ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
Message was not sent.Mailer error: SMTP Error: Could not connect to SMTP host.
 
Okay well then you need an smtp service on your machine if its not installed. Why not just use a 3rd party host, like gmail? You can connect to their smtp servers to send outbound email. Here's a great php mailer library i enjoy using: github.com/PHPMailer/PHPMailer
 
Does it make sense to throw an exception from a constructor of an exception?
 
@tereško Not really "advanced" though
 
10:46 AM
@RobMullins how to install SMTP services on my laptop
 
@VeeeneX it might be bundled in base system
kinda like OSX does
one more reason why to prefer the noob-unfriendly distros
@PeeHaa I am actually looking for lecture which explained how to do file upload with SQL injection
 
@tereško outfile?
 
yeah
 
AFAIK it is just a "normal" injection with INTO outfile /foo/bar appended
 
you have to add the content too, which is written
just making an sql dump is no fun
it has to be an executable script =)
 
11:00 AM
You can just UNION and append your own content right?
 
@PeeHaa "just" .. lol. You do know that most of people think that JOIN is too complicated to understand
 
:P
@tereško Last week I was at a client which had an in house developer. He told me he never uses JOINs because they are slow
 
this room has seriously misaligned definitions of "simple", "basic" and "easy" when compared to general developer community
 
Well for most things once you know the trick it is relatively easy :P
Then again. That's with most things
 
btw, I am currently running an experiment at work
they attached a second backend developer to my project (which has only done CodeIgniter up till now)
I am waiting to see what will be his conclusion on the codebase after 2 weeks with it
for now he seems to be doing most of the stuff as it's intended in the apps architecture
 
11:07 AM
Oh that is pretty nice
 
user1804599
@Kubo2 If it makes sense, it makes sense.
 
@tereško I did it with search and rm :D
 
user1804599
This is like asking "does it make sense to take an integer as a parameter to a function"?
 
user1804599
The answer is: it depends.
 
@Kubo2 not really, no
 
user1804599
11:08 AM
For example, if your exception constructor has a precondition that the argument must be positive, it makes perfect sense to throw an exception from that constructor if the argument is non-positive.
 
you throw an exception when something does wrong
and exceptions in constructor are usually thrown when input is incorrect
input for an exception should never be incorrect
 
user1804599
 
user1804599
Stack Overflow Chat is Very Good Software™
 
"one above all"
 
:D
 
11:10 AM
:-)
 
user1804599
I might write something in PHP today.
 
morning
 
@rightfold Oh god. Save the children!
 
user1804599
It's been about forever ago since I last did that.
 
@Worf MOrning
 
11:12 AM
Where is a git for php7-dev?
 
@VeeeneX github probably
 
master branch?
or in some another branch
 
user1804599
HTTP request and response abstractions would be nice, though. I've used Symfony's HttpFoundation in the past but it was suboptimal.
 
@PeeHaa subqueries can be more efficient than join
It's subject to profiling though
@VeeeneX for now, php7 is master branch
 
Thanks!
 
11:24 AM
@FlorianMargaine Sure they can. Be said person never used JOINs
Like not a single one in the entire application
 
Yeah, that's stupid
I'm not a smart one either, that said. I once built an app where all the queries were stored procs.
 
@FlorianMargaine I fucking hate you :P
 
I had a nice workflow tbh. I was in the repl and could very quickly edit/reload/test the queries
 
user1804599
Meh, I'll just use HttpFoundation.
 
11:33 AM
@FlorianMargaine Ooooh. I have seen for worse :)
@rightfold Rant about how much it sucks in 3... 2...
 
user1804599
:(
 
user1804599
What else exists?
 
@hakre o/
 
heja!
 
@rightfold Not sure what doesn't suck. All I know it I still regret I used httpfoundation for my last project
 
user1804599
11:35 AM
xD
 
    how'd you name this shortcut function? trim to range? fit to range?

    function PeeHaaSMother($number, $min, $max){
        return min(max($number, $min), $max);
    }
cc @PeeHaa
 
user1804599
clamp
 
@Worf getLowestNumberInRange?
 
@PeeHaa nope, it's not the lowest
 
11:46 AM
 
user1804599
:D
 
@Worf Oh I see
 
sold.
meh, i'll go with trim
 
a
 
b
 
12:11 PM
c
 
@PeeHaa sorry, I write maintainable code in SQL too
 
12:22 PM
riiight
I have been told that SQL is not productive and I should use ORMs
 
@Worf just minmax, it's a standard function in Game Theory.
 
@Danack cool :D
 
@PeeHaa I dont know what your strawpoll is about
 
12:36 PM
@Sara Sounds about right. My only question is, was that at the start of the writing the code, or the end of it?
 
@crypticツ Whether you name your SQL tables user or users
 
user1804599
lol user
 
oh 'users' of course since it contains multiple user records.
 
12:55 PM
select * from user where... just sounds wrong to me
What are you selecting? cells? body parts?
 
I don't use SQL. I use text files which I query using a PDO based wrapper for grep.
 
@Worf minmax and it should be added to core.
 
eheh
yeah i agree
 
Usually I use Users but I am trying out User atm
 
@PeeHaa singular
 
@PeeHaa: The strawpoll, you mean SQL table names, right?
 
Damn :P long time ago I used a windows computer. Is it still needed to use a virusscanner? Or is the one built in the system OK? ( Windows 7 )
 
@Duikboot i only use a firewall. after failing at searching a decent antivirus
 
Which one are you using?
 
1:24 PM
user image
8
 
i don't trust windows firewall so i use privatefirewall. it's very simple, it doesn't have adblocker spam filters and dumb things
but if you want to try something made this century Comodo firewall isn't that bad
just be sure to install only the firewall, not all the shit it comes with
 
Oh ok :)
thanks for your info.
 
np
@crypticツ easy, coz western digital is illuminati
 
@Worf jet fuel does not melt steel beams
 
Hey, are there any Paypal wizards about?
 
1:35 PM
@crypticツ it does! (two men in black are behind me!)
 
1:47 PM
@hakre yes
 
526
Q: Table Naming Dilemma: Singular vs. Plural Names

ProfKConvention has it that table names should be the singular of the entity that they store attributes of. I dislike any T-SQL that requires square brackets around names, but I have renamed a Users table to the singular, forever sentencing those using the table to sometimes have to use brackets. ...

 
Anonymous
singular and plural all the way
 
I'll bet if you put a label on a sock drawer you'd call it "Socks". — Chris Ward Feb 6 '12 at 8:02
:)
 
2:03 PM
@hakre that's the most useless "accepted answer" that I have seen this whole year
@samaYo actually the best way is "pick a convention as stick with it"
 
@tereško sounds like a good question to ask on meta: What is the most useless accepted answer on stackoverflow ever
 
.. and if your convention turns out to be fucked up at some point: change it in the next project, because chaning naming convention for DB half-way-thought is pointless agony
 
Anonymous
convenience is a bit subjective
 
"convention" != "convenience"
 
Anonymous
Isn't a covention a result of something being convenient to begin with?
 
Anonymous
2:12 PM
Anyway, it's way way out of my scope for now, so I'll stick with plural names for tables
 
Anonymous
Preparing for reddit's moronic monday to ask yet another moronic question.
 
Anonymous
Oh, so many questions to choose from
 
What I use are these rules:
- all tables in PascalCase
- all columns in camelCase
- table names in plural
- primary column constructed using "table name in singular" + "ID" .. ex: accountID
- foreign key columns use same name as column to which it is pointing
Basically, this simplifies the finding tables in large project and lets you use JOIN FooBar USING (FooID) syntax
 
Anonymous
2:38 PM
Hmm, I thought using _underscores was the convention to separating words
 
Different people use different conventions
 
Anonymous
anyway that's just too traumatizingly meticulous
 
When you have 50+ tables, it helps to avoid a lot of pain
 
> open source is like wearing tight pants, you need a big penis for that
 
yo
is it possible to get the return type of an internal php function?
 
Anonymous
2:46 PM
wild guess. NO!
 
Anonymous
unless with php7 No!
 
@marcio No, I don't think that information isn't even linked up anywhere.......which means there is a huge task outstanding for doing that.
 
@samaYo return types is a PHP 7 feature, ofc I don't want to do it on PHP5 ¬¬
 
Anonymous
@Danack with php7 return type hint, could ... maybe reflection be used to get that info?
 
> that information isn't even linked up anywhere.......which means there is a huge task outstanding for doing that.
 
2:52 PM
@Danack is it at least possible? looking at return_value is certainly not doable.
 
Anonymous
that is what I was asking ^
 
@marcio I doubt it's possible. I think something would need to be added to ZEND_BEGIN_ARG_INFO_EX (or similar) to allow a return type to be defined.
 
we already have the ability to define return types in arginfo
 
PHP_FUNCTION(some_function, RETURN_TYPES) { } ?
 
but it isn't used yet
 
2:55 PM
Do you know what would be needed to make it work?
aka be usable.
 
it should be usable now
not sure how many functions could realistically use it given how a lot of them have a "false" error return
 
maybe when we get Dog|array|false|null
 
zend_uchar type_hint;
What would be the valid values for type_hint would be for a class and a scalar?
 
IS_OBJECT and IS_STRING for example
 
ah, cool.
I wonder if we should even attempt to add that information in the declarations for PHP 7. Without union types it would seem to be a lot of work for not much gain, as it wouldn't be possible to complete it currently.
 
Nik
3:04 PM
Hi :) Okay, I know nothing of your language but please restrain from punching me. I'm trying to get PHP to execute offline on my notebook pc so that I may use some code. I've installed PHP files from the official site onto my desktop but I'm unsure how to proceed with the install. Clicking the PHP application only gets me some black terminal looking window that doesn't respond to anything I type in.
 
@Nik i) What operating system are you using? (windows, a mac) ii) Do you want to run stuff on the command line, or just through a browser?
 
@Danack seems legit
 
Nik
@Danack Windows 7, I just want stuff to run on the browser.
 
@Nik Ok, it sounds like what you installed needs more stuff to allow that - what I'd recommend is using something like wampserver.com/en to get started. It has PHP, a webserver and a database all installable as one package.
Once you've got a clearer understanding of what's going on, it's good to be able to install those things separately by yourself, but that single package is a good place to start.
 
Nik
@Danack Look, I'm just trying to get my browser to run a single line : <? print($_POST["q"]); ?> and it seems like overkill to get MySQL and Apache on my system as well, don't you think?
 
3:11 PM
@Nik php -S
 
Or that...
 
Nik
@PeeHaa Seriously, where do I type that? Powershell?
 
@Nik The cmd
 
Nik
@PeeHaa cmd.exe says php is not a recognized internal or external blah blah
 
@Nik yes, you need a webserver, and no, you don't need a database - but the fact that you're a windows user apparently unfamiliar with command line scripts, does suggest that installing something that sets up a webserver for you is a decentish idea.
 
Nik
3:15 PM
@Danack So... I'll never be able to run PHP client side?
 
@rdlowrey I'm going to try installing Windows today. Make sure any interim work on leviathon is backed up somewhere like github.
 
@Nik God I hope not
 
@Nik You said you wanted it to run in a browser, locally on your machine. That implies using a webserver locally. Either the rubbish builtin one that comes with php (aka PHP -S) or an actual webserver such as Apache.
 
Nik
@PeeHaa I'm "unfamiliar with command line scripts", so um, that sounds like I can go no further without either learning about it or installing wamp.
 
Yes
 
Nik
3:19 PM
@Danack Sounds reasonable.
Thanks guys for the help :)
 
np.
 
@tereško These people just don't want to learn SQL. Most things are easier in SQL than learning some proprietary API…
 
@LeviMorrison that was from the golden nuggets shared by our CTO
 
Hey guys. If your team uses multiple git repos (on github, but not necessarily relevant), do you know a software that can let you do code reviews on multiple PRs?
 
3:35 PM
@ocramius might have some advice related to that ^^.
 
3:47 PM
an actual reason to use true rather than TRUE that is not php-fig? uc is way more readable.
 
@hakre thank you
 
emm ... is there a built-in way for getting the first key of array ?
nevermind, there is
 
yes, it's key()
but it's actually the internal pointer key
 
@salathe you mean the comment?
 
@salathe ...damnit
 
@Andrea well, well, you oughtn't have fallen for that
 
@NikiC I did suspect
But what if it was real?
Though it wouldn't really make sense actually
 
It wouldn't?
 
Markdown doesn't support certain types of metadata docbook does
 
4:24 PM
There have been plans for, and a partial implementation of, such a transition
 
You'd have to add special tags or something
@NikiC oh no :(
 
Happy Caturday =]
 
$ sapi/cli/php
<?php

declare(strict_types=1);

function foobar(int $x) {}

foobar(1.0);
^D
Fatal error: Argument 1 passed to foobar() must be of the type integer, float given, called in - on line 7 and defined in - on line 5
Will this say "uncaught exception" at some point?
 
^ unlikely
 
@marcio huh - I thought that was the plan, and the current status was just to make the transition easier?
 
@bwoebi Would be good to display num operands in -p. E.g. SEND_VAL etc op2
 
@Danack I don't care about the "BC break" but some people seem to care.
 
@bwoebi I'm also getting L0-0 {main}() and then the opcodes are from L3 to L7
 
@Andrea there is also this ML thread, in case you are not a subscriber anymore: serverphorums.com/read.php?7,1178060
 
@marcio I think pretty much whenever he gives an opinion about exceptions - doing the opposite is probably the right choice.
 
4:39 PM
People are complaining that old log analysers and tests will break
Well, we're already breaking plenty of tests with existing error message changes
 
@Danack agreed :P
 
@NikiC yeah, works on functions, but not on main, no idea why actually…
@NikiC Not sure what you mean?
 
@bwoebi Some formally UNUSED operands use op.num. Currently that will just be shown as <unused>
the SEND opcodes are an example
 
Well, that needs specific handing in code, feel free to add it, I don't know all the cases. Relevant place to introduce that extra handling: lxr.php.net/xref/PHP_TRUNK/sapi/phpdbg/phpdbg_opcode.c#108
But I'll look again at it [the main 0-0 lines issue]
 
I recommend you add a prefix like "Uncaught " to the exception messages, @NikiC. Otherwise:
ElePHPant: party
Stack trace:
#0 {main}
throw new ElePHPant("off a cliff");
 
4:48 PM
@Andrea An ElePHPant… THROWING IT OFF A CLIFF?!?! You … have no heart for elePHPants :-(
 
@bwoebi I am not that evil. Only someone like @Ocramius would be heartless enough to write code like that.
 
Oh, you stole it from @Ocramius code? Well… no wonder :-)
 
I didn't, but I wouldn't be surprised if he wrote it...
 
@Andrea Yeah, was planning to do that
 
He does evil things. Like access private variables of classes using closure binding.
 
4:50 PM
@Ocramius is the root of all evil?
 
Well, if he does such evil things in his code, who knows what he does in real life?!
 
@Andrea Well… that's sane.
(if used in contexts of sanity)
 
function getPrivate($object, string $property) {
    static $getter;
    $getter = $getter ?? function (string $property) {
        return $this->$property;
    };
    return $getter->call($object, $property);
}
I really should've added ??= while I could. Oh well.
 
Let's call it a bugfix… ;-)
 
might be difficult to implement, dunno
 
4:55 PM
why should it?
we anyway need a write fetch
should be a rather small patch
@NikiC reason is because line_start/line_end is only set on function_decls…
 

« first day (1652 days earlier)      last day (3282 days later) »