« first day (1469 days earlier)      last day (3469 days later) » 

2:01 PM
yeah sure
I think that the original proposal minus a few things would be a good place to start ;)
 
:-)
 
@Feeds hehehe
 
@NikiC Except that the default unset() behaviour for public fields is wrong...
 
@DaveRandom unset() on an accessor should be an error, obviously
and isset() should always be true (well, maybe with that stupid null check)
 
2:07 PM
@NikiC not just an assignment of null?
Error would be inconsistent, unless you are going to make it an error on regular fields as well
 
@ircmaxell if mutators and accessors are going to be most of the time single line why not just make the syntax simpler and define what's happening when you define the Class fields?
 
@ziGi huh?
 
Example:
 
if it's a single line, public $foo; still works
 
^ that
 
2:08 PM
@SergeyTelshevsky i have changes error reporting but now getting some diffrent error
 
At the very very least I would like to fix unset behaviour on regular fields, actually removing a declared property from the table is stupid
 
and we would see public $foo; coming back btw...
if we can change the mutator/accessor without breaking the external API, there's no reason not to use it
 
class Foo {
    property $foo read getFoo write setFoo;

    getFoo() {
        return $this->foo;
    }

    setFoo($foo) {
        $this->foo = $foo;
    }
}
 
wow, that's pretty ugly
 
you are pretty ugly
with your chest hair
 
2:11 PM
Your mother is ugly.
 
well, getting personal? I'm out of this discussion then :)
 
hahaha :D
 
dammit, beat me to the punch
 
well telling me my code is ugly is already personal
 
it's not.
 
2:12 PM
yes it is
it si a suggestion I made
you are telling me I am stupid
right now
 
Your idea is bad != you are bad
Everyone has bad ideas...
 
if my idea is bad
why do the do it in Delphi and it is so useful
 
@ziGi Nobody is saying you're stupid, just that this particular suggestion is stupid ;)
 
especially you can split it better in IDE-s
 
2:13 PM
hi everyone
 
It should be noted that these particular bike sheds have already been repainted hundreds of times
 
for the exact same reason people don't have the reserved word `with` which IMHO is really useful cause instead of writing
$this->field1 = a;
$this->field2 = b;
$this->field3 = c;

you could write
with $this {
   $field1 = a;
   $field2 = b;
   $field3 = c;
}
 
is it possible to pass 2 variables in a query string? i have a id and a title that matches the id , i need to display the title on the other page
 
@ziGi I dislike that strongly, because it makes order of a non-trivial stretch of tokens important. Meaning that there's a lot to parse. Now, if you did:
 
@LukeSmith you mean the result of the query
 
2:15 PM
class Foo {
    property $foo {
        read getFoo;
        write setFoo;
    }

    getFoo() {
        return $this->foo;
    }

    setFoo($foo) {
        $this->foo = $foo;
    }
}
I don't like that, but I think it's cleaner than the 1 line approach...
 
@ziGi idk, I never liked that particular construct. I generally find that when I see people using it it's a bad API
 
@ircmaxell I agree with you
 
@ircmaxell Dangerously close to wiki.php.net/rfc/propertygetsetsyntax-v1.2
 
@DaveRandom that's because C and C-like languages never had it so you haven't experienced the convenience of it
people are like this, they don't like new things that facilitate their life
 
Yes, yes I have, I have written a lot of VB
 
2:16 PM
@ziGi js doesn't count as C-like?
 
@ziGi yes
 
that is why right now I see arrays that have repetition
 
1 hour ago, by ircmaxell
@JoeWatkins dislike. I would rather have var $value { public get() {}, protected set($value) {}, default = 12 } or something like that
 
And as I say, I generally find that when I see people using it it's a bad API
 
@DaveRandom I think in general that syntax was good. I think it was overcomplicated for other reasons
 
2:16 PM
@ziGi i need to echo the title but i cant as its not the the query string
 
@DaveRandom exactly because you are used to it
 
@ziGi i need to pass the id as thats how i get the content from the db
 
@LukeSmith when you execute the query you get result in the form of an array
if you have: SELECT title, author FROM books WHERE bookId = $id then you get multiple rows that have title and author
 
There's not usually a good reason to call something over and over again on a single object, it's syntactic sugar for making it cleaner to use a dirty API. The better thing to do would be to fix the API...
 
@ziGi hi yes but the problem is on the page where i receive the get request
@ziGi i want to pass two variables in the one query string
 
2:19 PM
@DaveRandom may I give you an example and you give me a solution?
@LukeSmith you want to send 2 get variables not one?
 
@ircmaxell Disagree but literally no point in arguing about personal syntax preferences :-)
 
@DaveRandom well, what would you rather see?
 
@ziGi yes :)
 
@ircmaxell something like that
 
@ziGi the id and the title (name of the page)
 
2:20 PM
for example java uses the '@' sy,bp;
@LukeSmith getUrl: 'webpage\getBooks?id=5&title=Robinson+Cruso'
 
@ircmaxell I prefer something like Joe's suggestion of distinct, ungrouped functions, because that's kind of what they are
 
then on the PHP side you do $getParams = $_GET;
 
@ziGi java has annotations. A completely different beast.
 
@ziGi If you like
 
yeah but you can do easy setters and getters with annotations
 
2:21 PM
@ziGi this is my current code
@ziGi echo "<li>";
echo "<a href=\"page.php?page=";
echo urlencode($id);
// echo $title;
echo "\">";
echo "$title";
echo "</a>";
echo "</li>";
 
well, my issue with that is it's hard to cognitively separate them from other methods. And raises the cognative load to see that there's a property there, and not just normal methods
 
@ziGi now $title needs to be passed into the query string
 
exactly, let's look at the more abstract perspective of properties
property should define a controlled access to class fields
the OO concept is that internals should be hidden from the outside
while many fields could be externally accessed
by placing them public
instead property can define whether a field is readable, writable or both, or just internal
 
@ziGi the word you're looking for is "encapsulation"
 
haha, you are really funny Florian
I know what encapsulation is
I am explaining it in a simpler way so anyone could understand it
 
2:25 PM
@DaveRandom It may be like a method implementation-wise, but usage-wise it's a property.
 
the good part about properties is that you can say in a much easier and more flexible way how something is accessed instead of always implementing accessors and mutators
 
<?php
class Foo {

    public function __construct($value) {
        $this->value = $value;
    }

    protected mutator value($value) {
        $this->value = $value * 2;
    }

    public accessor value() {
        return $this->value * 4;
    }
}

class Bar extends Foo {

    public mutator value($value) {
        $this->value = $value;
    }
}

$t = new Bar(10);

var_dump($t->value);

var_dump($t);
?>
someone can always fiddle with the patch with me ...
 
where can we find the source?
 
@ziGi doesnt work :/
 
2:28 PM
@ziGi is works!!1 thanks man but i get this &%20
 
ok people throws up hands in the air. Anybody knows whether phpseclib is any good?
 
@LukeSmith that's because some special symbols like space cannot be set in the GET
so you have to use
 
Oh god that syntax
ew
 
@LukeSmith urldecode($title)
to get it back to a normal string
@PeeHaa you shouldn't use phpseclib, didn't you hear, it got deprecated
 
@ziGi I am far too annoyed right now to even make an attempt at a funny comeback :P
 
2:31 PM
What I want: public readonly $foo { get { return $this->fooBar * $qux; } set ($value) { $this->fooBar = $value / $qux; } };
 
@AndreaFaulds why do you have public and readonly
 
you're set on on your readonly keyword :D
 
@ziGi your the man.Thanks alot dude
 
@AndreaFaulds var $foo { public get { return $this->fooBar * $qux; } protected set ($value) { $this->fooBar = $value / $qux; } }; imho a lot more clear
 
@LukeSmith sure no probs, ask if you have any further questions
 
2:32 PM
@NikiC Adds too much complexity and means the variable itself has no specific visibility
Also means you can do insane things
Like something with public set and protected get
 
no specific visibility?
 
@AndreaFaulds it just has separate visibility for read and write
 
@NikiC why do you add var? what is the purpose of var? That's not javascript dude
 
@NikiC What about referencing?
 
@AndreaFaulds and nothing principally wrong with that. "writeonly" to complement the "readonly" ;)
 
2:33 PM
Though I assume such things wouldn't support it
 
@ziGi will do :)
 
@AndreaFaulds referencing can be supported to the same degree as it is for __get. You can use &get to return a ref.
though likely you wouldn't for most of the use cases where you'd make use of accessors
 
why are you people reinventing the wheel?
 
it's not like people haven't thought about it 20-30 years ago
 
2:35 PM
@NikiC Why wouldn't it be set?
 
@PeeHaa what do you want to use it for?
 
@ircmaxell I have to work with ssh in php. I try to make it less painfull
 
yeah, go for it
 
@PeeHaa ssh2_connect?
 
@AndreaFaulds it's just how php works.
 
2:36 PM
@ircmaxell great. tnx!
 
^ shortest joke ever
 
Hmm.
@NikiC I think any new getter/setter proposal should be the basics and nothing more. Otherwise it risks being rejected for the same reasons as before.
 
"PHP works"
 
@AndreaFaulds I think that is the basics
It supports get/set and visibility for them
 
@AndreaFaulds people are conservative haters, that's why it got rejected, because there are people like @DaveRandom who says "Bla bla, not good API, bla bla, I am not used to the syntax" :D
 
2:37 PM
however, to make it useful you'll likely also need abstract / interface properties. which is probably more problematic ^^
 
That means you MUST use a property for visibility control. Why?
 
@AndreaFaulds I don't worry about if it'll be rejected. I worry about what the right thing to do is for the language. If that's rejected, so be it. But I think it's wrong to propose a sub-optimal feature for the sole reason that it's the limit of what will be accepted
 
Why take the perf hit? :/
@ircmaxell Well, I also wouldn't be in favour, myself, of a super-complex proposal
 
@ziGi I think you missed the less painful part :P
 
You can always start hating on them for rejecting your idea on your blog or Twitter
 
2:38 PM
@AndreaFaulds the old rfc also supported the short notation of var $foo { public get; protected set; }. That would allow you to change visibility without actually using a virtual property or anything
 
and then some people would Tweet about it too
but at the end, the only thing you do well is to feed the corporate cats working for Twitter
 
@AndreaFaulds not arguing that. But it should be simple because the basics are what is needed, not because it's what you think will be accepted
 
@ircmaxell Right
 
it's the same thought, just from a slightly different angle
 
@PeeHaa what do you have to do exactly?
 
2:39 PM
Hmm
 
@ziGi keyword reuse
 
@NikiC I actually like that
 
@ziGi Long story short: 5 machines, 1 centralized server which needs to run commands on the other machines
 
@NikiC Actually I'd prefer properties in interfaces ober property accessors...
 
public/protected $foo;? public:protected $foo;?
 
2:40 PM
Not allowed to make the environment more sane
 
I'd rather have that than C#-style... which changes the shape of the declaration entirely
 
@bwoebi I don't think properties in interfaces make sense without accessors
 
@FlorianMargaine I'd agree there.
 
@AndreaFaulds no need to save chars. why not have something explicit (that also directly integrates with real accessors)?
 
@PeeHaa what about ssh2_exec then?
you can execute commands, get result, not really hard
 
2:42 PM
@NikiC It changes the order of the declaration... and it makes it look like non-getter/setter plain properties aren't
 
@AndreaFaulds That's necessary complexity, imho.
 
@ziGi pecl always scares me :P
 
@AndreaFaulds aren't what?
 
@PeeHaa why?
 
@NikiC Aren't plain properties
 
2:42 PM
@ziGi Because horrible
 
@FlorianMargaine I'd like to define write access. But not make getters/setters...
 
whether or not they are plain properties is an implementational detail
it shouldn't matter to you whether they are plain properties or accessors
 
And because not my server
 
OK, but it still makes anything with differing visibilities use a completely different syntax. That's bad for readability.
 
It's more explicit, yes. Which I think is good for readability. If you see public get; protected set; things should be pretty obvious. If you see public/protected it doesn't make a whole lot of sense without context
 
2:45 PM
You could make it be public get protected set $foo, though.
(Which is maybe too verbose for me...)
 
@PeeHaa spoiled much?
 
user895378
morning
 
Morning @rdlowrey
 
morning @rdlowrey
 
Hmm...
 
2:46 PM
@ziGi If that is the verdict, I am ;-)
 
Maybe the answer is redeclaring the property?
public readonly $foo {
    public get $foobar;
    protected set $foobar;
};
 
user895378
@Danack ah the dreaded file descriptor limit! Have you tried increasing your ulimit? In any case, I'll start fiddling with it today.
 
That keeps the normal order. Though it's a little weird...
To be honest, I'd much rather have public/protected $foo
 
@AndreaFaulds what use is the readonly keyword there?
 
@PeeHaa it would have been nice if there is a tool that you just say
$hostnameConnectionArray = ['192.168.1.1', '192.168.1.2', '192.168.1.3', '192.168.1.4', '192.168.1.5']
$manager = new ServerManager ($hostnameConnectionArray, $sshUser, $sshPass);
$manager->on(2, HOURS)->in('/var/www')->do('rm -rf .');
 
2:48 PM
@salathe shit, wrong paste.
 
@AndreaFaulds eek
 
class FooBar {
    public get $foobar;
    protected set $foobar;
}
^ that's what it was meant to be
 
@PeeHaa what I suggest that will facilitate you is to write .sh scripts and just use PHP to run them
 
@AndreaFaulds eek
 
How about: public $prop { get; protected set; } ?
 
2:49 PM
I'm not so keen on it myself.
 
@ziGi How can I run remote shell scripts using php?
 
@Leri where do you implement the get method?
 
Personally, I wouldn't want to mix visibility on the same property.
 
@Leri That's like a frankenstein of the two ideas...
 
@FlorianMargaine Inlined as in C#
 
2:50 PM
@Leri yeah, that's what C# does and what the original proposal for PHP does
but I don't like the asymmetry in it
 
Ditto
 
would rather separately and explicitly declare visibility for both
 
@NikiC It's perfectly symmetric, imho: outer access modifier is for both and if you want you can override either for getter or for setter.
 
@RonniSkansing Black-rolled?
 
user895378
@Danack Every simultaneous socket connection, every php extension .so file and every php file you include in your program counts against this limit. Also, I'm not sure how php://temp works under the hood but its possible all of those downloaded entity bodies are using up file descriptors as well (if they're over 2M in size). You may have to start storing some of your entity bodies on disk until you're ready to work with them. Anyway, like I said I'll poke around ...
 
2:52 PM
See, C#'s syntax handles everything, which is nice. But it completely rearranges the property declaration :/
 
@FlorianMargaine If you want custom code, you'll just open braces.
 
Websites are some sneaky mofos with your plain-text links, <code> links and many other non-sanitary ways of displaying links!
Farkers.
 
phpseclib is actually pretty fucking nice
 
@rdlowrey What's weird is that the file limit is 'unlimited' (which may actually be some sensible value) but also I just can't see that many file descriptors being opened - it seems to be only a few hundred.
 
$connection = ssh2_connect('locahost', 22);
ssh2_auth_password($connection, 'username', 'password');

$stream = ssh2_exec($connection, '/opt/scripts/customScript.sh');
 
2:55 PM
@ziGi Now try to su
 
user895378
@Danack It may also depend on php's self-imposed --enable-fd-setsize=8192 compile directive. I'm just spitballing for now until I can test, of course.
 
user895378
(default is 1024)
 
@PeeHaa easy, but not recommended, if you can, better make the files owned by the user you log in with so you don't have to sudo
if you have to
 
user895378
which is easy to exceed in a non-blocking program like this where you've got a ton of things open at once.
 
hmm....1024 - is not that much more than I was thinking were open.
 
2:57 PM
$stream->write('sudo command');
$stream->read('Password:');
$tream->write('the-sudo-password');
@PeeHaa usually su is bad practice, you should better sudo
 
This is not up to me
Also: that is exactly what I am doing ;)
 
@PeeHaa wut?
ok, still don't understand your problem
 
I don't have control over the other machines and only limited control over the central machine
 
just open a ssh stream and use normal commands as you do when you use some client (like Putty for Windows)
 
@rdlowrey What I'll do is recompile PHP with the higher limit. If the issue I'm seeing goes away it's pretty certain that the issue has been found.
 
2:59 PM
@ziGi That is what I am doing...
 

« first day (1469 days earlier)      last day (3469 days later) »