« first day (1596 days earlier)      last day (3352 days later) » 
00:00 - 17:0017:00 - 00:00

pce
5:06 PM
@VeeeneX i see, phalcons ini adapter reads the ini file with parse_ini_file in the constructor and explode for the dot syntax to array. And similar in the JSON Adapter like you did.
 
5:31 PM
@AllenJB currently i am making a small site: whoisextractor.in
 
@LeviMorrison tons with scalar types
 
5:54 PM
hello every one
 
good morning
 
morning
if you working in software company, how can you credit your code. what type of license and header on top of each file?
 
Most software companies have agreements that you sign to accept employment
and they'll often mention that any work you do at the company is technically their intellectual property
 
@Rican7 yes so ?
 
:/
 
5:55 PM
@bwoebi interestingly, the two extra variables that are only written to, are picked up as unused variables on Travis and so give an error due to -Wall whereas they're not picked up on in Centos.
@Rican7 I usually cross that part out before signing.
 
I mean like what should be default header of the file
 
@FaizRasool at my company, I create a file-header with my company's copyright
 
@Rican7 can you kindly show me one simple
 
@Danack yeah, some versions of gcc mark variables which are only written to as warning and some don't.
 
5:57 PM
i'm using that one
<Project Name>
Copyright (C) 2015 <Company Name> trading as <Training Name>.
Support: <support@support.com>

Created: <dd/mm/yyyy>
Created By: <Full Name>, <Example Company>
Modified: <dd/mm/yyyy>
Modified By: <Full Name>, <Example Company>
Version: <2.0
Trading name :p
 
Oh god, you us a Modified By:?
that must be a pain
 
That's copyright assignment.....there shouldn't be any problem signing that. But it's different from all 'intellectual property'.
 
My point is like, i'm starting new job from next week as in house developer in the one consultancy
i'm going to create their entire interface on zend framework
but i want to credit my self
 
you could use an @author tag
 
gotcha :) @Rican7
let me create on template header
Robin API is that your project name or file function it self?
 
6:02 PM
that's the project name
 
can we define the file function as well?
 
that same exact header is in every file
we use different doc-blocks for the class itself
and then different ones for the constants, properties, methods...
 
@Rican7 if you don't mind can you show me demo
 
@JoeWatkins #faceplam
 
6:11 PM
@JoeWatkins I think you've said where you've worked before - it's definitely not FB or google is it?
 
@Rican7 appreciated
 
it's not
 
@FaizRasool no problem
@JoeWatkins your UString class, do you see yourself using that for pretty much all user-input?
 
pretty much yeah
 
it would be so nice to have automatic coercion to a class like this from a regular string
 
6:26 PM
we might use it for database stuff too ... I have a project on to write a vitess driver at some point, so I might try something there that might be applied to any PDO driver ...
 
but yea, not happening, haha. The Dream™
oh, nice
 
Hey @JoeWatkins we sometime need to finish phpdbg docs…
 
@bwoebi did you see phpstorm early access features ?
they seem to have their own debugger ... so what we need to do is move forward with the remote stuff ...
 
@JoeWatkins didn't look at a PHPStorm EAP in the last months… why?
@JoeWatkins yeah… remote stuff in in PHP 7 branch. I need to finish protocol docs…
 
well I think that needs an RFC
 
6:30 PM
@JoeWatkins sure? Is there some extension?
 
@bwoebi didn't say, just said "inline debugger" ...
 
@JoeWatkins hmm? :o
 
@JoeWatkins no, I don't want a RFC about this. I need to finish the current status in master which already is there since a few months.
 
I'm not sure that we have a choice
 
6:33 PM
@JoeWatkins well, it's already a long time there? Didn't we agree back then to not have it in 5.6 but in 7?
It's in master since at least October.
The only thing I don't want, is discussing it on internals and fight with Derick & Co.
 
@bwoebi Nothing was agreed except that you wouldn't commit stuff related to it without either doing an RFC for it, or making sure that everyone was okay with it. Which seeing as the cut-off date for PHP 7 is approaching means that you're really running out of time to get it done.
 
They just now will object it'd be too late etc.
Either we do it without a RFC… or it's a fight I won't participate. I'm tired of battling for such things.
 
How about just finishing the code and then getting someone else to ram the RFC through? Making life difficult for other people is how some people in internals try to win the argument.
 
I think you are being too negative. The need for superior remote operation is legitimate, the right RFC will absolutely pass. I'm not sure we have the right implementation, not just because of Derick, but because most of internals agreed with Derick, not us.
 
@JoeWatkins They disagreed with introducing it into a micro…
Also, no full docs at that time.
@JoeWatkins If you do a RFC, I'll support you, I just won't fight myself.
 
6:45 PM
I don't relish the thought, but bet we could ask Phil to do it for us ... he'd need input ...
this conversation should probably be had with a wider audience than just us three though ...
 
I wouldn't mind running the RFC - tbh so long as the API is sanish no one will have any real objection. There will be a massively vocal objection from one person, but that won't be for technical reasons (mostly).
 
@JoeWatkins I'd just like to see the phpdbg work all in php 7. And I hope we won't have problems with timeline…
@marcio you wanted to put some RFC to vote, no? =)
 
there ya go, @Danack will do the RFC
 
7:02 PM
Can someone help me with some code?
$rand = rand(1000,10000);
$username = '';
$password = '';
$database = '';
$command = 'mysqldump -u$username -p$password $database > /store/database' . $rand . '.sql';
system($command, $output);

if($output != 0) {
echo 'Error during backup'; }
else {
echo 'Database saved';
// rest of the php script to modify the database (create/drop tables etc)
}
 
dude says some strange things @Danack
 
its always returning 'Error during backup'
 
@bwoebi Which one? Context sensitive lexer needs one more week.
 
@kelunik That one. It was proposed two weeks ago.
 
Discussion started 20th feb.
 
7:06 PM
@AshSimpson lolwat
 
I am trying to save a mysql dump
but I am getting an error
$rand = rand(1000,10000);
$username = '';
$password = '';
$database = '';
$command = 'mysqldump -u$username -p$password $database > /store/database' . $rand . '.sql';
system($command, $output);

if($output != 0) {
echo 'Error during backup'; }
else {
echo 'Database saved';
// rest of the php script to modify the database (create/drop tables etc)
}
 
@kelunik Oh. Date: 2015-02-15 is creation date…
 
Why are you using rand ???
 
its always saying 'Error during backup'
To avoid overrite?
If it saved a lot..
 
Why?
 
7:07 PM
Because it is saved every time a person visits the webpage
 
Rand is the worst thing you could use
 
why?
 
Also making a full database backup on every visit sounds batshit crazy
 
I am going to put it into a cron job
this is just for testing..
I am putting it in a daily cronjob once It is final
 
Have you tried echoing the command and running it manually?
 
7:09 PM
How do you mean?
I am new to PHP
 
There is not much more to explain I'm afraid
 
I am echo'ed it but I don't understand what you mean by running it mainually
 
From the command line run the echoed command
 
I have changed the command line
as it was just echo'ing the variables
$command = 'mysqldump -u'.$username.' -p'.$password.' '.$database.' > /store/database' . $rand . '.sql';
It is still saying Error during backup
 
I gave you all the information you need. Good luck
 
7:13 PM
I am still getting error during backup
when doing what you said
 
yohaa
 
yojoe
 
user895378
morning.
 
morning good looking
 
What, ya got cooking?
 
user895378
7:16 PM
@PeeHaa what you said doesn't work. I need you to fix it for me so I can copy/paste.
 
Reddit desperately needs an ignore button.
 
@rdlowrey ?
oh lol
Bit slow today. Sorry :)
 
user895378
hehe
 
user895378
@Danack yeah there are some people who think they're qualified to comment on everything.
 
user895378
7:18 PM
When they're actually qualified to do little more than read. And it's always the same people. And they desperately want to sound like they know what they're talking about.
 
I have been drinking last night so for a moment I thought I said something to you last night without remembering it :P
 
@bwoebi If you're asking because of in operator timeline, we could probably have a "Yes", "Yes, if context sensitive parser passes", "No" vote.
 
when reading a message I have written telling someone to shut their mouth, I can't help but wonder if I'm not one of the knob heads on reddit ... I'm usually pretty calm guy, it's only on reddit that I find myself being aggressive ...
or internals, sometimes, but I rarely go there any more ... I have phil for that ... and great at it he is ...
I need a reddit guy ...
 
@JoeWatkins phil is on reddit too… ^^
 
yeah that was his thread ... probably should have left him too it ...
the chorus of disagreement is comforting, thanks all ...
 
user895378
7:32 PM
> I'm usually pretty calm guy, it's only on reddit that I find myself being aggressive ...
 
user895378
^ likewise
 
user895378
@JoeWatkins link so I can send in some backup? oh nevermind I see it.
 
Hey I am having an issue can someone help me?
I am trying to create a mysql dump but it is only saving as the first part of the file name?
 
@rdlowrey <3
 
I am naming it the date and time, example :Saturday 28th of February 2015 08-26-43 PM
And it is only saving the file as 'Saturday'
 
7:45 PM
> Static route "/reset-password/success" is shadowed by previously defined variable route
<3 @NikiC
 
can someone help me please?
 
@PeeHaa You're welcome ^^
 
@bwoebi woot. Is it Sunday already? xD
 
@marcio I really thought so.
 
user895378
@NikiC I'm going to write up a yield * RFC tonight/tomorrow so I can send it to the list for discussion in time to initiate a vote by feature-freeze. Can you give me an honest assessment of the likelihood that you or someone else could implement yield * so I know if I'm wasting my time?
 
7:52 PM
@AshSimpson Just run "mysqldump options | gzip > `date +%Y%m%d%H%M%S`.sql.gz"
 
@bwoebi Well we can start it right now if you think it's necessary. Discussion is so quiet :/
 
@marcio Weekend is always a calm day on internals… and yeah… too many discussions… nobody cares about your RFC now :-D
 
even Stas said it was a good idea, let's hope it's a good thing.
 
8:07 PM
@bwoebi Was very quiet the last days, not only the weekend.
 
@kelunik Quiet, almost as if the coercive scalar RFC people have realised how much BC break that RFC has.
 
@rdlowrey likelihood for php 7 is 0
 
A lot more SelectMark as ReadArchive clicks. ^^
 
@bwoebi going afk again, but will open the voting ASA get back //fingrs crossed.
 
user895378
@NikiC fair enough. I won't rush to do it today then. Thanks for the honesty :)
 
8:11 PM
I won't have a compile-capable machine at my disposal for the next week, so I can't work on this ^^
So I guess we should postpone that to PHP 7.1 ;)
 
@NikiC If you could show me what you have until now, I could work on it after 4th March…
 
@NikiC relief... I thought you was moving to Hack or something.
 
user895378
I don't desperately need the functionality right now but it would be nice to have. It can wait if it needs to.
 
Only condition would be having a RFC set up until tomorrow… @rdlowrey
 
user895378
@bwoebi So you think I should go ahead and do the RFC then?
 
8:15 PM
yes.
 
user895378
It's just going to be rushed because I have plans in a couple of hours so I'll have to spend lots of time on it tomorrow to finish in time :)
 
@rdlowrey Even if you only finish it tomorrow… you still can polish it after announcing
 
user895378
feature-freeze is always such a hectic time lol
 
user895378
Everybody rushing to make stuff happen.
 
Yeah, just good that the discussion period is two weeks… then we have still time to polish things in a rushed time.
 
8:23 PM
@bwoebi I pushed my current work in progress state: github.com/nikic/php-src/compare/…
But I didn't implement anything yet, I got stuck thinking about how stuff should behave
And I'm still not sure on that ^^
Which is also why I wouldn't want to push this for PHP 7, it needs more time to stew ;)
 
@NikiC You mean how the syntax should work or how you need to manipulate certain internal states?
 
@marcio I haven't tried Hack yet
@bwoebi How it should work and depending on that there are different approaches for the state ^^
 
@NikiC I think I have a clear idea how syntax should work… But that's also why I really want that @rdlowrey does a RFC: to see how things must behave.
 
user895378
@bwoebi I will be sure to have something I can post to the list for discussion tomorrow.
 
@bwoebi @rdlowrey The main "interesting" cases are when a generator that is part of a yield* is also accesses externally (e.g. via an explicit call, foreach or another yield*). Also consider this at various levels of the delegation hierarchy, not just the leaf case.
 
8:38 PM
@NikiC could you show a small code sample?
 
user895378
Interesting. My first inclination is to say any modification of the generator's current element pointer outside the yield * context should be an error but I haven't thought about that case before. I wonder what other languages do in that situation.
 
At least in Python it should be possible
 
user895378
yeah that's what I was thinking ... looking over the python implementation now ...
 
And there's nothing wrong with it ... it only makes thinking about a stack-based implementation somewhat nontrivial
 
user1804599
lol stackless coroutines
 
user895378
8:41 PM
I really hate how python uses exceptions for flow control all of the things.
 
user895378
It makes it so easy to crash your script on accident when everything throws. And it forces you to be aware of every possible scenario where things might throw ... too much knowledge is needed IMO.
 
user1804599
I can't say I ever had any problems with that.
 
user1804599
You must always assume that any functions you call can throw exceptions.
 
user1804599
So you should properly use with and finally.
 
user895378
Yeah, which is ugly IMO.
 
user895378
8:43 PM
Using exceptions for unexceptional situations is an anti-pattern (so says me).
 
user1804599
It also expresses intent correctly.
 
user895378
Using exceptions for flow control like that is essentially the same as goto.
 
user895378
You're just long jumping from one place to another.
 
user1804599
goto is nice.
 
user895378
I love goto :)
 
8:45 PM
@rdlowrey I don't think Python's use of exceptions is particularly bad. There's only some weird things like GeneratorExit
 
user895378
Yeah, things like this are WTFs:
 
user895378
> In a generator, the statement return value is semantically equivalent to raise StopIteration(value)
 
user895378
^ gross.
 
yeah and that too ^^
Altho I do see a certain elegance in having an Iterator API with just one method ;)
 
user895378
Maybe. It seems like faux elegance though because you're still introducing all these other new exceptions to manage the actual behavior. You've just shifted the behavior out of methods and into try/catch.
 
user895378
8:49 PM
> The assumption made is that, in the majority of use cases, the subiterator will not be shared. The rare case of a shared subiterator can be accommodated by means of a wrapper that blocks throw() and close() calls, or by using a means other than yield from to call the subiterator.
 
user895378
semi-related.
 
Yes, I've seen that
 
user1804599
I love PHP.
 
...
 
user895378
Right now I'm thinking a shared generator iterated/completed outside the scope of the yield * should just resume at whatever happens to be the current position of the subgenerator. If the subgenerator is no longer valid we just send its return value to the parent. Does that make sense? Are there problems with that that I'm missing?
 
8:55 PM
 
user895378
@Danack \o/
 
user1804599
PHP 7 should borrow from Perl 6!
 
If you want to write an RFC, how about fatal errors dumping a stack trace (eg. OOM) (which I don't believe are covered by the Exceptions in the Engine RFC, as I read it)
 
@AllenJB In general that's a bad idea - exceptions during exceptions are a world of hurt trying to handle properly.
 
@rdlowrey So you would use its return value even if the return actually did not happen during the respective yield*
E.g. in python you'll only get the StopIteration with the value once. You won't get the value afterwards again on another next() call
 
9:00 PM
In the particular case of out of memory - someone ought to draft an RFC for allowing there to be a soft as well as a hard limit for memory - and allow a callback to be called for it.
 
user895378
@NikiC Hmm actually no. I think the python behavior is correct there.
 
Which could e.g. call gc_collect_cyles() which may free up enough memory to keep execution going.
 
user895378
function subgenerator() {
    yield 1;
    yield 2;
    return 3;
}
function delegator(Generator $shared) {
    return yield * $shared;
}
// finish the shared generator before it's passed to the delegator
$shared = subgenerator();
while($shared->valid()) { $shared->next(); }

$delegator = delegator($shared);
while($delegator->valid()) { $delegator->next(); }

// because the shared subgenerator didn't actually return its value during
// yield * iteration it is not returned to the delegator.
assert(is_null($delegator->getReturn()));
 
user895378
@NikiC ^ so basically this?
 
yes, that's what I would expect
And that's what Python does, I tested it
I am however not sure how this can be implemented efficiently with these semantics and without additional restrictions
Python uses the easy way (just walk the yield froms on every resume), but I'd like PHP to ship with a proper implementation
 
9:13 PM
9/10 "(see full text)" links exist only to remove themselves
 
user895378
So it's really more about figuring out how to implement the behavior efficiently than deciding what the behavior should be at this point.
 
Hmmm, Something is unidentified i.imgur.com/jEa30fT.png
 
Probably instead of maintaining a stack in the calling coroutine, the called coroutine should maintain a list of coroutines it is currently being yielded from and unregister itself from them when it finishes
 
user895378
That sounds sensible /cc @bwoebi ^
 
user895378
Writing this RFC is going to occupy my entire Sunday ...
 
9:28 PM
Hello
 
@pce I had done some tests take a look at it:
* please take a look at it ^
 
@JoeWatkins @NikiC @Danack @rdlowrey you kids had some fun on that reddit it seems
silly bugger that one
@JoeWatkins how we doing with this anonymous classes RFC? when do we do a vote?
 
@rdlowrey well, I'd expect yield * to iterate until it's finished and then return the return value of the iterated generator (regardless whether it already was finished or not).
keep the definition of it simple…
 
user895378
I'm not really sure if one is "more correct" than the other. Doing the above might be easier to optimize for efficiency because once the subgenerators complete they could just unregister themselves from the calling routine's stack (as in @NikiC's message above)
 
9:44 PM
Just to ensure that we're talking about the same thing: stacking approach currently would imply to maintain the stack at the bottommost yield * generator and makes problems when a Generator in between is advanced.
So we could share the stack through the Generator as a simple linked list where every level holds an indirection to its level of the linked list?
 
advancing a generator on the intermediate level will implicitly advance the lowest generator
 
yep
 
though you may not have an up-to-date state and might have to find the lowest first ^^
 
So we just need to store at what level we advanced (the highest level)
and then go up the chain to find the lowest again
 
store what at the highest level?
 
9:49 PM
I mean, store the highest level we advanced
 
I'm not sure what you mean, so I'll just say "yes" :)
2
 
evenin'
 
lol
 
/me is still fretting over choices of monitor
 
10:06 PM
@tereško For work or play or both?
 
kinda "both", but primarily for play
I have been salivating over this one, but it's really fucking expensive
 
@tereško did you see that meta thread?
 
yup
fuck 'em
 
haha, good answer.
 
Can anyone help me with this question stackoverflow.com/questions/28787378/…?
@tereško that monitor screen looks awesome although you might as well go OLED TV Hook up if you paying that much
 
10:20 PM
emm .. no
a 1080p OLED tv costs at least $4K
 
@tereško I haven't tried anything with a resolution bigger than 2560x1600, but I can say that unless it's a ways away from you I wouldn't even buy one that large for play
At my desk at home a ~23 inch screen is a bit too big
(because it is so close to me)
If you can reach out from your sitting position and touch it you probably don't need anything physically larger than 23"
(Unless you have uncharacteristically long arms, I suppose)
 
@LeviMorrison it's probably way too big if you have t-rex arms
 
user895378
Morrison's First Law of FrankenArm Monitor Necessity
 
user895378
@LeviMorrison ^
 
10:31 PM
@LeviMorrison Yeah, I agree, there's no need for more than that (or similar sizes like 2880x1800… but always in the same order of magnitude…)
 
I seem to remember someone asking about a static constructor to initialize static members of classes.
Is that ringing any bells with you guys?
 
@LeviMorrison yes. And that is why I'm drinking.
Feb 22 at 14:35, by someone
@RonniSkansing why do you hate __callStatic() ? it's really good that you don't have to instanitate the object every time you need to use some of it's method.
 
Oh, I didn't mean __callstatic but something like __constructstatic
 
@LeviMorrison A modest proposal
/4th time the charm
 
I'm not sure why you need that… you can just put an yourClass::init(); call after it's declaration…
 
10:40 PM
@bwoebi No you can't if the init call has to be after some other code.....
 
@bwoebi I'm playing around with the viability of pure userland "enums" like Java did before it has language support for them.
 
@Danack well, then static ctors don't help either
 
That is correct.
 
I'm not sure I need them, but it was the first time I ever had the thought "static ctor would be nice"
And what Patrick proposed doesn't seem to be what static constructors were in my head.
 
Perhaps you still have the flu and are hallucinating?
 
10:42 PM
static ctor..?
 
Do we have a way to get all the constants of a class without using reflection?
 
no, but you can put arrays in constants since php 5.6
so FOO['foo'] would work
if you have const FOO = array('foo' => 'bar');
Isn't it close enough?
 
Where it can be useful? pastie.org/9990552
 
OIS
arrays in constants ... sounds so useless
 
OIS: enum/status type stuff
 
10:54 PM
@OIS no it is awesome..
 
OIS
stuff should usually be in configs or class/interface constants
I don't really see the need for global constants
 
@OIS Why should everything be bound to a class?
 
OIS
why do you want to put so much in constants you have to make it an array?
 
OIS an array can be 2/3 things.
 
@OIS Because i) I have many constants, ii) some of them should be grouped together, so that I can do in_array($CHANNEL_CONSTANTS, $channelType);
 
OIS
11:01 PM
I don't really see that
I'll need an example
 
@OIS like this:
function adjustImage($foo, $channel) {
	if (in_array($channel, $CHANNEL_CONSTANTS) == false) {
	    throw new InvalidChannelException("Value of $channel is not a CHANNEL constant.");
	}
	//Do some operation that uses $foo and $channel, which is now definitely a valid
	// selection from CHANNEL_CONSTANTS
}
 
const COLORS = array('red' => 33, 'blue' => 34);
echo COLORS['red'] . $text;
 
Although arguably strong types are really what I want...
 
OIS
const COLOR_WARNING = 33;
don't call it red
call it by its purpose
 
hahaha
wow
 
11:04 PM
@Danack in_array($channel, CHANNEL_CONSTANTS, true) :P
 
calls for a quick example. picks holes in arbitrary stuff
 
@OIS I meant red. My example was related to terminal escape characters.
 
@PhilSturgeon It was like that when I got here....
 
@Danack not crapping on your code, dont always assume im being an ass :)
 
OIS
@FlorianMargaine ah ok :)
 
11:05 PM
nothing wrong with that approach at all, i do exactly the same thing
(in ruby cough)
 
No, no - I'm crapping on it. It's far too many things, and they shouldn't be bound to the class - they should be in a namespace.....
but hey PHP.
 
OIS
I think that should be a seperate constant not a part of an array
 
i do enum validation, where a class property has a few possible values and the const array contains them. that stuff in general is the bit i do
 
OIS
cause its... constant
 
This is a good as time as any - who should I talk to about windows.php.net and getting them to change some stuff?
 
11:08 PM
@ois
```
function adjustImage($foo, $channel) {
if ($channel != CHANNEL_CONSTANT_WARNING && $channel != CHANNEL_CONSTANT_FATAL && $channel != CHANNEL_CONSTANT_ERROR) {
throw new InvalidChannelException("Value of $channel is not a CHANNEL constant.");
}
//Do some operation that uses $foo and $channel, which is now definitely a valid
// selection from CHANNEL_CONSTANTS
}
```
 
@Danack Anatol.
 
@PhilSturgeon ctrl + k
@PhilSturgeon or hit the "fixed font" button
 
k.
 
ugh im not that invested, you get the idea
 
OIS
channels should not be in constants ...
 
11:09 PM
OIS who cares about the name im using the example
 
OIS
I'm just trying to imagine a use case for arrays in constants
 
DECLINE_REASONS_WHITELIST = [:additional_time, :not_enough_savings, :car_is_full, :pick_up_too_late, :pick_up_too_early, :other]
thats some ruby I use for validation
 
@OIS we just gave you 3
 
it could be a property but it doesnt change. its a constant, so i make it... constant
now, tell me more about how to name my variables
;p
 
OIS
11:10 PM
:)
 
sorry for the ruby, just happened to be on my screen and CBF to dig up some PHP equiv
 
@OIS CHANNEL_RGBA has a specific value that has to be passed to the underlying library for it to be used correctly. What the fark do you think it should be if not a constant?
 
Would you prefer drokk?
 
OIS
rgba ? hex string?
 
11:14 PM
@OIS const HTTP_FOO = [100 => 'Continue', 101 => 'Switching Protocols' ...
 
OIS
those are constants yes, usually the other way around ...
 
@OIS From the library, CHANNEL_RED in PHP has to equal RedChannel from MagickTypes.h
 
OIS
why not just call it CHANNEL_RED instead of CHANNELS["RED"] or CHANNELS["red"]
 
16 mins ago, by Danack
function adjustImage($foo, $channel) {
	if (in_array($channel, $CHANNEL_CONSTANTS) == false) {
	    throw new InvalidChannelException("Value of $channel is not a CHANNEL constant.");
	}
	//Do some operation that uses $foo and $channel, which is now definitely a valid
	// selection from CHANNEL_CONSTANTS
}
 
CHANNELS[$color] ?
 
OIS
11:21 PM
if (!defined("CHANNELS_$color")) { throw chair; }
 
CHANNELS_$color ?
 
OIS
sorry, "CHANNEL_$color"
 
and if I wanted to do as per my previous example .. $message = STATUS_FOO[$status_code]; ?
and I am not sure that the string parsing is that elegant a solution
 
This still needs some work but if people want to give feedback that would be awesome:
 
OIS
11:30 PM
"elegant"? compared to array constants is elegant ...
with http status you usually check for what you can handle, everything else is a big pile of can't handle
 
imo a lookup in a array is more clean that parsing a string to create a string to match a constant.. anyways it's not really about the names might as well have been const LOCALE = ['da_DK' => 'Denmark' .. ]
 
00:00 - 17:0017:00 - 00:00

« first day (1596 days earlier)      last day (3352 days later) »