« first day (3686 days earlier)      last day (1255 days later) » 
00:00 - 23:0023:00 - 00:00

12:00 AM
I will PR it I guess :-P
I apologise for my slightly snotty tone before @Dharman, turns out this really is long af
 
Sorry, I went away to post an answer and I didn't follow the convo
 
cmb
dunno what's wrong with PhDOE, but maybe there's another conflicting patch around?
 
exactly that yes :-P
did you do that via svn from local checkout?
I did have that working once and hooked up to web storm which was semi-helpful with wrangling the XML, it took me sooooo long and so much shouting at my computer to make it work to my satisfaction though, I don't think I can do through it again#
I am a bit drunk possibly :-P
I should put the internet down, I have had 2 small beers and they have gone right to my head
 
cmb
yes, from a local SVN checkout; works quite fine with VS code and TortoiseSVN
 
@cmb I am interested in discussing this further at some point in the near future if you are willing
 
cmb
12:09 AM
yeah, of course; just ping me then :)
 
cheers :-) ttfn
 
 
2 hours later…
1:59 AM
@DaveRandom I thought I was the only one hitting this issue, but weirdly the files which choke seem to depend on the user
Also svn from the CLI is not that bad once you figured out the command...
 
 
3 hours later…
Jpv
5:12 AM
Hey guys, quick question. Lets say I have a class that builds a product. and this has its methods to get / set values. However, if the product does not exists, and someone attempts to use a public method, this will fail. a solution is to check if the product has been populated (by checking a property). Instead of adding the line of code to every public method, is there any way to have php execute a line of code / function before accessing any public method?
 
5:30 AM
@Jpv It seems to me that you may be going about this the wrong way
So your class is a product in itself, or it is a product builder?
 
Jpv
a product builder
based on the id, the constructer fetches all the needed data from the db.
lets say $product = new StoreProduct(123);
this will fetch all of the product data. if no product exists, then the property "public $product" will be set to false.
so, now lets say i have a public method get_color( ); which will return the color of the product. But if the ID is invalid, we can't fetch this property.
 
You should probably realize that the product doesn't exist at the time that you retrieve it and avoid trying to get any properties of it
 
Jpv
I know a solutions would be, after initiating the class, they have to check if $product == false, before continuing, or else there will be php error. but i would rather always return false than a fatal error. So for every public method, i would like to run ($this->product == false) return false; at the begining
 
This is what exceptions are for, they are not fatal errors unless you don't catch them
 
Jpv
5:45 AM
hmmm. i'll look into it. thx!
 
You can do
class StoreProduct
{
    public function __construct(int $productId)
    {
         // Product doesn't exist
         throw new Exception("Product doesn't exist.");
         // or if you make your own exception...
         throw new ProductNotFoundException("...");
    }
}
Then when you're instantiating it you would just wrap the instantiation in a "Try" block and handle it not existing in the "Catch" block
try {
    $product = new StoreProduct(123);

    echo $product->name;
} catch (Exception $e) {
    // Exception thrown, product doesn't exit
    echo "The product doesn't exist";
}
@Jpv php.net/manual/en/language.exceptions.php Here is some good documentation for it
 
Jpv
oh I see, the catch will have to be done outside the class. at this point then, who ever is going to use the builder, they should know to check if the object is false before trying to access the methods
 
6:01 AM
The exception is triggered from inside the class, an Exception is an error
But it's an error in the form of a class called an Exception
As soon as you throw an exception then the code below that doesn't get called. The Catch block will only happen if the exception is thrown
for example...
function echoName(string $name = null)
{
    echo "Hi there.";

    if ($name === null) {
        throw new Exception("I don't have a name"); // If there is no name the code stops here
    }

    echo "My name is " . $name; // This only gets called if an exception was not thrown
}
So if I do echoName(); it would echo "Hi there." and nothing else, since there is no name. If I do echoName("scorgn"); it would echo "Hi there.My name is scorgn"
doing throw new Exception(); is throwing an error, if nothing catches this error then it causes a fatal PHP error
so to "Catch" the error, you wrap your code in what's called a try / catch block
 
Good morning.
 
try {
    echoName();

    echo "Done!";
} catch (Exception $e) {
    // I've now "Caught" the exception that was thrown in the try block. This code will only execute if there is an exception thrown
    echo "There was an error.";
}
If you catch it like that, then it's not a fatal error and inside that catch part, you do what you need to do based on the fact that the product doesn't exist
@Tpojka 'morning
 
@scorgn You don't need = null part. Typed parameter should do it's job. Except it is ?string $name = null i.e. you are allowing null value.
 
@Tpojka You don't need to define it as a nullable type if the default is already set to null, but I usually do anyways because I think it's nicer
I'm not sure what you mean by the first part though
Not needing = null. Are you saying I don't need to define the variable default as null if it's already typed as nullable?
 
It's ok but if you don't declare it as so, exception will be thrown either way, that's why typed parameter is.
 
6:14 AM
Oh I see yeah but that wouldn't have explained Exceptions as well I was just using an example
To show manually throwing and catching an exception
 
Going with specific [exception] class is ok.
Also, ckeck multiple catch in block if appropriate.
 
7:09 AM
posted on November 18, 2020

 
7:23 AM
morns
 
7:38 AM
Morning!
Is someone else having problems with their @php.net alias on Gmail? I can't use that anymore :(
 
 
1 hour later…
8:47 AM
@cmb Would you accept a PR to phd (I guess to phd) which would change NULL/FALSE/TRUE to null/false/true in the manual? :D
Also, how problematic it is for you to apply all my commits? If it is, I'm ok to set up SVN for myself.
 
9:23 AM
@MateKocsis that wouldn't be a PhD change
 
9:53 AM
@salathe ah thanks for the info!
 
cmb
@MateKocsis that would need to be done in doc-base
@MateKocsis it's okay-ish for now :)
 
Hello, anyone know of a Phalcon in PHP package for version 3.4
 
10:19 AM
@KerrialBeckettNewham Just ask concrete question.
 
Trying to find a PHP version of the Phalcon framework v3.4, does anyone know of such a package?
 
phalcon is C, isn't it?
 
@Derick yes, it's a C extension, but uses an intermediary language called Zephir, which is similar to PHP as far as I can tell.
 
@Ke
@KerrialBeckettNewham AFAIK, phalcon 3.4 is dead an unmaintained, btw works with PHP 5.5 to 7.3
(but don't really understand what you are asking for)
phalcon v4 is now released on pecl, older versions can probably be found on github
 
10:35 AM
@RemiCollet @RemiCollet Believe me I'm aware! :P So the Phalcon framework is written in C, and the framework is only available in PHP during runtime, which is converted from C to Zehpir to PHP. If you try and run any PHP tools on your code outside of runtime, it'll tell you the framework classes don't exist. So I need a PHP version of the Phalcon framework to run PHP tools, like Rector.
 
I'm not aware of any pure-PHP implementation
 
Ugh, looks like I'm going to have to convert it myself. 🤢
 
10:50 AM
@cmb Thanks, I saw that. Do you know what the zphalcon package is? is it the converter? or a converted version of Phalcon?
 
cmb
I don't know; never worked with Phalcon.
 
Yeah, the readme is like one line long and no install instructions lol. could be heaven in a package and we wouldn't know...
 
guys it is possible to count the numberes of 1's on this array without loop?

const arr = [1,0,0,0,1,1,0,1,0,1]
reduce and filter is looping the array..other idea?
 
Wes
not possible without a loop
 
@NoobDEV-GBL maybe you could use array_count_values()?
 
10:58 AM
@KerrialBeckettNewham ya...but..that is not looping?
 
Could do, I'm not sure. was just reading the docs php.net/manual/en/function.array-count-values.php.
 
@Wes i don't really now if is a yes or no
 
Wes
O_O
 
length() and sum()
 
@FlorianMargaine what do you mean?
 
11:01 AM
there's no loops 🤫
with sum() you have the number of 1s, and with length() you have the total number of items in the array, so a simple subtraction should be enough to find the number of 0s
 
Wes
the array can only contain 1's and 0's?
 
yes
 
Wes
doesn't sum() iterate too?
 
to sum() you will loop dont you?
 
11:04 AM
@NoobDEV-GBL are you asking this question because it's homework?
 
Wes
unless you saved the data in an adequate data structure, like a hash-bag/counter... you will always need some sort of loop
 
its a challange
@Wes tanks
 
Hey! I have a segmentation fault - who can spot where the error lies? gist.githubusercontent.com/dragoonis/…
Where is lxr.php.net, do we have a new tool or hostname ?
Update - this is NewRelic's agent extension, and it's stuck in an infinite loop.
 
@PaulDragoonis heap.space
 
good, thanks
I have 38000 lines of the same gdb output, an infinite loop. Can someone help me debug this further? perhaps which PHP file is starting the loop?
 
11:25 AM
I don't have time and it would be blind leading blind anyway :-P sorry
 
11:38 AM
Opcache misses executor_globals ・ Compile Failure ・ #80377
 
11:58 AM
Morning
 
12:10 PM
@PaulDragoonis nr_php_execute doesn't exist in php source code, but does exist in new relic extension - discuss.newrelic.com/t/php-agent-8-1-8-5-segfault/64907
 
morns
 
morning
 
You should report it to new relic. If you wanted to debug it, I would suggest running it through GDB, and attempt to put a breakpoint inside '#21 0x00007f08908d40e0 in nr_php_execute'. That might not show the bug occuring, as presumably gets called with different parameters before it its the bug.
If that's the case, then if you can find an appropriate parameter value for that function call, a conditional breakpoint might allow you to break on the exact callback that is being executed in a loop....
but I've never done that in gdb.
 
syntax error in php://input ・ FPM related ・ #80378
 
12:29 PM
hey guys, i have this array and i want to intersect all of 3 sub arrays , i wrote call_user_func_array('array_intersect',$array) but return without any data,
$array = array (
'16528062' =>
array (
0 => 'alireza',
1 => 'value_3',
),
'1507073550' =>
array (
0 => 'alireza',
1 => 'value_2',
),
'18006213' =>
array (
0 => 'value_1',
1 => 'value_5',
),
)
 
Nevermind, I misread
 
I don't know what to do, it'll work with 2 array, but not working with +2 arrays
 
what are you expecting as the result?
and, more importantly, why is that the result you expect?
i.e. what does "intersect all of 3 sub arrays" actually mean to you?
because I would expect an empty result from your input data, there are no elements which appear in all 3
 
show a working example. The call_user_func is pretty useless like that - you could use array_intersect($array['16528062'], array_intersect($array['1507073550'], $array['18006213']))
 
12:44 PM
@Sjon actually I think the call_user_func_array actually is useful there, it ignores keys and just passes elements in sequence
it's not the same as array_intersect(...$array)
(I think)
 
@DaveRandom alireza
 
my array is like this :
16528062 => array(),
1507073550 => array(),
18006213 => array()
 
cba checking rn :-P
@Tiffany not in the third element
 
Oooh
 
and ofc it does have same value in 2 arrays,
I expect an array with all similars between all 3
 
12:45 PM
@Tiffany that's what I mean by wanting a definition of the desired operation :-P
 
@DaveRandom ah, missed that
 
@MahdiAlikhani There aren't any in the example you gave
 
@Sjon it's ok with that, but I'm comparing data from database and it's not 3 arrays always, it might be 4 or 5,
@Tiffany can i send a screenshot here ?
 
You can, but if the screenshot is of code or an example, that's annoying. Use gist.github.com or pastebin
 
no it's not from code, from result
array:3 [▼
51577692 => array:5309 [▶]
16528062 => array:1139 [▶]
1507073550 => array:18 [▶]
]

I have "alireza" in first(51577692) and 3rd (1507073550) arrays,
how can i get it as result ?
 
12:50 PM
It has to be in all three though
Being in two doesn't matter
 
oh! then how can i get it ?
 
@MahdiAlikhani please go read sscce.org - if you want people to help you, you need to ask your questions in way that can be understood. We don't have enough bandwidth to help everyone...
 
Get what?
 
get "alireza" that similar in 2 array,
 
@Tiffany aren't you meant to be working?
 
12:51 PM
@Danack in an hour :P
 
@Danack thanks,
 
oh, I woke up early today....
 
@Danack 6:50 AM
 
@MahdiAlikhani you need to define, in general terms what operation you are trying to perform, the exact conditions by which an element should appear in the result
do you want all elements that appear in more than one of the input arrays?
 
@MahdiAlikhani exclude the third array
 
12:54 PM
blah....encouraging people to give a textual description......when they obviously don't know how to do that........ sscce or gtfo.
 
consider Instagram as source, Instagram check mutual users between 2 users,
i want to do the same,
i have an array which related users with each key(userid) users and i want to find mutual between each 3 users
 
hwæt!
 
Need a gif of your edits
 
Sadly I don't know any proto-indo-european, so the journey ends here...
 
I take it you're feeling better today :) (maybe)
 
12:58 PM
More awake (got some decent sleep) but also feeling fighty.
 
function array_something(...$input)
{
    $values = [];

    foreach ($input as $array) {
        foreach ($array as $value) {
            $values[$value] = ($values[$value] ?? 0) + 1;
        }
    }

    $result = [];

    foreach ($values as $value => $count) {
        if ($count > 1) {
            $result[] = $value;
        }
    }

    return $result;
}
free code. doesn't happen very often round here
not from me anyway
 
@DaveRandom you've written code in the past year now, you're done for another year
 
:-/
 
Only if you want to
 
@MahdiAlikhani yeh, but does that mean "mutual between all 3" or "mutual between at least 2"
they are 2 different things
 
1:00 PM
@DaveRandom Thanks for adding that constant into the documentation. Would it be a good idea to mention since when it is available? github.com/php/php-src/commit/…
 
when was it added?
 
@Danack Sokath, his eyes uncovered
 
if it was at or before 7.2 then it's irrelevant
 
@DaveRandom Incorrect, if it was introduced after PHP 7.0.0 it needs to be documented in a changelog
 
7.3 in fact, 7.2 will be out of support in like 6 weeks
@Girgias ? since when
 
1:02 PM
@DaveRandom manual operates differently
 
lies.
 
The PHP doc is meant to document every change which happened as of PHP 7.0.0, and be glad we recently dropped from PHP 5.0.0.
 
I'm sure I read that somewhere but maybe I dreamed it
:shrug:
 
But it seems to be available since PHP 7.0 as it looks like it's merging PHP 7.0 into PHP 7.1 and up
 
@DaveRandom yes, my bad, mutual between at least 2
 
1:03 PM
that will only work if all the values are valid array keys
 
Strange that I can't see it in the changelog. The commit says it was added in 7.1.0
 
if not then you will need to use a more complex data structure for $values that can cope with whatever types you need it to
 
but the commit tags have earliest 7.2.0
 
@DaveRandom thanks, i tried but i got Illegal offset type error
on this line : $values[$value] = ($values[$value] ?? 0) + 1;
 
@Dharman Yeah, GitHub seems to be drunk, or maybe it's the merging upwards which messes stuff up
 
1:19 PM
@Trowski No, it doesn't make sense. I think it needs to be possible to write an example that doesn't pull in the class github.com/amphp/ext-fiber/blob/master/scripts/Loop.php as that is too much code for people to understand.
Preferably, there should be at least one example with minimal code all in one file of something simple (like timers) running "in parallel", just so people can see all the parts at once.
 
25 mins ago, by DaveRandom
that will only work if all the values are valid array keys
24 mins ago, by DaveRandom
if not then you will need to use a more complex data structure for $values that can cope with whatever types you need it to
read the code, understand what it does, and figure out how to fix the problem in the scope of your requirements
you might need an object storage data structure, or some sort of x-type hash table, depends what the range of possible values for your input is
 
cmb
1:45 PM
@Dharman yes; there happened a big mess; anyway, docs fixed
 
dics foxed
 
Also about the DoE, Yannick Torres is going to look into it, just had an email chat with him
 
oh sweet
cheers
 
It came about because I broke the French translation build buuuuut whatever xD
 
eh, French is a dead language anyway
runs away giggling
 
1:50 PM
I'm still surprised that so many French devs work with PHP compared to other languages
 
@DaveRandom Thanks man, that code helped me a lot, I'll change the structure,
 
cmb
@Girgias will there also be an update of extJS (AFAIK it still uses v3)?
 
extJS?
I can send him an email about that but what is it?
 
2:06 PM
@cmb Thanks
 
cmb
@Girgias it's the JS framework used for that app (en.wikipedia.org/wiki/Ext_JS)
 
Let me ask him :)
And a definite NO from Yannick:
* Would take too much time that he doesn't have
* DoE is stable and has many small neat little features
* Too many things have changed
 
2:26 PM
evenin
 
E_MORNING
 
:p
 
how's it going?
 
@DaveRandom svn to git migration? Is php-src migrated from svn to git?
@DaveRandom all good. :)
 
src was migrated to git years ago
it's only really docs left in svn now afaik
 
2:35 PM
I never thought of that, there can be migration possible from one version control to another.
 
php-src started life in cvs, then svn, now git, maybe something else in the future, who knows
although not the near future :-P
 
Is there any reason for that?
 
well git is the defacto standard for *nix flavoured foss projects and it's also just generally better than svn, but it didn't exist when PHP was started
afaik the only reason that docs are still in svn is because of all the incidental tooling built around svn, i.e. mainly the DoE, though I don't pay much attention to mailing lists these days and haven't really been part of recent efforts to move all that stuff along
 
It's more about how the sync between EN and translations work from my understanding$
 
oh yeh I remember that now you say it
 
2:40 PM
But could be some of the other tooling too
 
something about incremental revision numbers vs hashes
 
Yeah, but I think the revision number needs to match perfectly but might be wrong about that
 
I was trying to read the docs for migrations svn to git last nite but of no use . :p but looking at that it looks like very tough task.
 
But it's way harder to track if something is before or after another revision by just looking at a hash
 
the main problem, I think, is that there are cumulatively about 3.7 people on earth who understand the infra, and no-one understands all of it
@Linus it depends on the repo and how complicated the history is, and how much of that history you want to retain
obviously there's nothing stopping you doing svn up; git init; git add --all; git commit -m "Initial commit" :-P
 
2:46 PM
:D
 
there are numerous tools which can replicate an svn tree into git keeping the commit dates and everything, if it's uncomplicated enough that there is a reasonable representation of it in git
 
3:06 PM
"When comparing to a numeric string, PHP 8 uses a number comparison. Otherwise, it converts the number to a string and uses a string comparison" - does the otherwise refer to PHP<8 ?
 
I think this is ready to go: github.com/php/doc-en/pull/188
 
cmb
@Sjon no, that refers to "a numeric string"
 
@cmb I'm missing something. The first part says they are compared as numbers. 'otherwise' they are compared as strings
I'm missing what the otherwise refers to
 
cmb
If the string is numeric, they're compared as numbers. If the string is not numeric ("otherwise"), they're compared as strings.
 
@cmb ah, right. Thanks :)
 
3:15 PM
It's still a confusing sentence, I think.
 
it's a confusing concept :-/
 
^this, my brain is still fried from going through all the edge cases
 
That too.
 
I think it can be articulated better, but 2 mins of staring at it have not yielded a phrasing I like
 
3:26 PM
> When comparing to a string in PHP 8, the comparison operation used depends on the value of the string. If the string is numeric, a number comparison is used; otherwise the number is converted to a string and a string comparison is used.
better @Crell @Girgias @Sjon?
 
@DaveRandom yes
 
where in the manual is that from sorry? :-P #lazyweb
 
Yeah, I think we really should have a dedicated page for numeric strings instead of that being bundled in the string type section, but don't know what that would be
 
@DaveRandom github.com/naruzl/web-php/blob/… but it doesn't allow reporting issues ...
it's from the new PHP8 splash page
 
sorry, news of this magic has not reached the underside of my rock thus far
 
3:32 PM
Much improved.
 
Interesting... instana.com/blog/… /cc @beberlei @Gordon
 
3:58 PM
"Interesting" indeed
 
Wes
if i remove the last reference to some value in a destructor, will that value be destructed right away?
 
Jan 27 '16 at 1:00, by Danack
Was it exactly the same question? A glitch happens when they change somthing.
 
Wes
public function __destruct(){
    unset($this->bar);
}
1 message moved to Trash can
i can invite myself to the trash can
 
> The destructor method will be called as soon as there are no other references to a particular object, or in any order during the shutdown sequence.
but relying on destructor call order is.....an exciting way to code.
 
Wes
i think i have a gc problem but not quite sure yet, need to try adding static function(){} at random first :B
that usually solves it.... usually
 
4:08 PM
Most of the comments left on that page (I deleted most of them) come down to "destructors are messy and you can't rely on them."
 
4:19 PM
@LeviMorrison I know, right?
 
@Danack @kelunik is putting together a FiberScheduler using ext-curl that should provide an example that would not need to defer to outside code. I wouldn't consider it a "short" example, but it's probably the minimal you'd need to do something one would consider useful.
Timers are challenging without deferring to an event loop because I can't use sleep() directly.
 
"do something one would consider useful." - I don't think that's the goal.....which I think should be to show how Fibers operate so people can understand them separate to other libraries.
@Trowski is there anything that can be used? maybe someting like watching files?
 
@Danack sockets and stream_select could work… that won't be a short example either.
The problem of course is we're not writing parallel code, instead the code is concurrent and cooperative. I need something that will await an event, but is non-blocking.
I could probably pull out what the event loop is actually doing in this example to create a self-contained example: github.com/amphp/ext-fiber/blob/master/examples/004-sockets.php
Otherwise… I could write something that executes in two fibers but is completely blocking anyway. The problem I see with that is people taking that example out of context and saying that the fibers don't do anything useful.
 
4:39 PM
> Please note that variable variables cannot be used with PHP's Superglobal arrays within functions or class methods.
Has this always been the case or is it new with PHP7?
 
I haven't used variable variables since PHP 3 was cool, so I don't know.
 
You could always plug it into 3v4l.org and see what PHP 5 spits out
 
I'm just upgrading some old zencart code to get it working with 7
 
@Trowski what about doing something like, inside the docker container setup a couple of processing that create some unix sockets, and write some spoofed data to them every second. And then an example using sockets and stream_select would be relatively simple....presumably?
 
3v4l.org is probably your best bet to figure out what happens.
 
4:45 PM
Seems so, cheers
 
@LeviMorrison huh that is unexpected ! :)
 
on cloud services like heroku is computation more expansive or data storage ? , background I could build my app without storing data , but it would need to do more computation
 
Oct 22 at 18:14, by Danack
then probably do whatever is easiest for now...as it sounds like whatever you choose is likely to be wrong...
developer time is very likely to be more expensive than storage costs for a long time...
 
@real_hagrid It's going to vary by the service, and how much computation and storage you need. There's no universal answer. (Disclosure: I work at Platform.sh, another cloud service.)
 
5:06 PM
@Danack I could make an example that reads from stdin and writes back to stdout after some delay.
*would not work on windows.
 
> So cry me a river - instead of complaining about firewalls go deprecate bash and rewrite the complete set of shell code out there. Either that or suck it up, be a nice neighbour and do your best to cope with real life needs of customers.
users.jpg
 
5:30 PM
@Trowski I think that's fine, personally, as long as it's clear in the example that is the case
 
Yes, I doubt most would care about that detail.
$this->sendValues[$position - 1] = [null, null]; will always reference the same zval that was created during compile time no matter how many entries I make to $this->sendValues, correct?
I'm adding pairs of values to an array, but 99% of the time it will be [null, null]. Wondering if I could optimize that case then.
 
@Trowski looks like it 3v4l.org/pDBZE compared to 3v4l.org/t4kCE
with the compile-time constant, memory usage only increases with hashtable reallocs, when it's dynamic it increases on every iteration
logical conclusion is that it's a reference
 
Yep, so that's actually a win to not be allocating a new array for the common case.
It does require a couple more compares, but that's probably way better than allocating memory.
Guess I can benchmark that too :-P
It's a hot code path in Amp, otherwise I wouldn't care.
 
depending on the impact I might take the memory footprint reduction over speed anyway
if the comparisons are for a 2 element array which is most frequently the same ref then it's probably fine though :-P
 
5:46 PM
@DaveRandom This is what I'm looking at: github.com/amphp/amp/blob/v3/lib/Internal/EmitSource.php#L118
I would add if ($exception === null && $value === null) { $this->sendValues[$position - 1] = [null, null]; }
It also only happens if the consumer is trying to consume multiple values, so many it's not that "hot" of a codepath.
I may have gone too far down the optimization rabbit hole :-P
The first condition in the if is way more likely.
 
@Trowski yeh makes sense, I can't really comprehend what the impact would be without seeing tests though
I tried but my brain protested, done too much thinking today :-P
 
6:02 PM
A better optimization is probably to change all the occurrences of $position - 1 to $position and add one later.
 
6:16 PM
@Trowski It does work on Windows, but always blocks for 100ms I think.
 
@kelunik Cool, I thought it just blocked completely.
 
@Trowski There's some special handling for STDIO IIRC.
 
  hey guys, got a newbie question. Why variable test is showing null?
    class Bar
        {
          static public function staticMethod() {
    		$test = 'test';
    		function foo(){
    			$html = 'this is' . $test;
    			return $html;
    		}
    		foo();
    	}
        }
 
@winresh24 PHP doesn't 'inherit' scopes for variables. the function is completely separate from the outer scope
function foo() use($test) { blah blah }
 
I see, got it thanks
 
6:21 PM
Good day!
 
would capture the variable, which is what you want.
 
great variable 10/10 would capture again
 
8/10. You could have confused him with arrow functions.
 
I might start leaving reviews of specific PHP stdlib functions on trip advisor
 
6:28 PM
@DaveRandom strip_tags() 1/10. Wasn't at all what I expected. Was not clean as promised. Left unsatisfied and vulnerable. Very disappointed.
 
What do you mean strip_tags() 1/10? It works almost fine for me
 
explode() 3/10. Burned my fingers when it detonated.
 
or just split foo() into another method of the class :P
 
@DaveRandom String fragments everywhere, some were even empty!
 
utf8_encode() 9/10. ����� ������!
5
 
6:31 PM
Lol
 
6:44 PM
@DaveRandom utf8_encode() ⁹⁄₁₀
 
Serious question though, why don't we simply deprecate utf8_encode()?
 
7:01 PM
Something something reasons, also "simply" is never as simple
It needs to pass the RFC bar
 
The only time I ever seen it being used is when it was misused.
 
utf8_encode/decode() <--- Tired
UConverter <--- Wired
Encodings are hard <--- Galaxy Brain
 
What does the U stand for?
 
Unicode
 
Why?
 
7:05 PM
The underlying library ICU calls it that.
 
"Unsolvable problems"
 
In hind sight, prolly shoulda been IntlConverter
 
As the comment says it should have been called iso88591_to_utf8
 
I'd have settled for latin1_to_utf8
 
this_does_not_what_you_think_it_does()
@StatikStasis where are my switch streams?
 
7:22 PM
 
@kelunik Why is the promise class not part of amp?
 
@PeeHaa It's a self-contained example for the RFC
 
8:20 PM
@Derick Thanks a lot for the talk again! Getting my hands on right now.
 
8:43 PM
PHP 8.0.0RC3 (cli) (built: Oct 31 2020 17:06:24) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.0RC3, Copyright (c), by Zend Technologies
    with Xdebug v3.0.0beta1, Copyright (c) 2002-2020, by Derick Rethans
 
8:54 PM
So a story in three parts, starts off amusing github.com/Marak/faker.js/issues/1046, transfers to the medium of song: soundcloud.com/marak/marak-the-node-js-rap , and ends with the bomb squad investigating: abc7ny.com/suspicious-package-queens-astoria-fire/6425363
 
@Danack would you consider the story be a classic drama?
 
More of an always sunny in philadelphia thing....
 
Excuse my ignorance, I dunno what that means...
 
@hakre It's a TV show where the jokes are 'non-traditional' and based more around everything being just a little bit off e.g. youtube.com/watch?v=eFdnyITLpxI&ab_channel=RottenTomatoesTV & youtube.com/watch?v=-yUafzOXHPE&ab_channel=t91
 
9:11 PM
@Girgias Wow, I've just tried the atomic push for the first time that you talked about! I loved it! :)
 
@MateKocsis \o/
 
9:55 PM
@Girgias how close to Yannick are you sitting that you can ask him questions......? Also, I believe he might want to talk to systems@php...or Derick.
but I'm not getting involved.
 
@Danack I'm just sending him emails in French, as he's one of the main translators
And it seems pretty likely he wants to talk to systems, or maybe the Russian person which made the Online editor work again
 
Sergey I think?
 
Maybe
Man must love SO, commenting that one should probably not use empty() because it has whack semantics and that the code in question is working and that the output provided is likely incorrect netted me downvotes
bruh
Memo to self, don't answer shit on SO
 
Wes
10:11 PM
@Danack used to love sunny, but i never liked danny the vito
so stopped watching it.....
i am a fool, i know
 
cmb
10:29 PM
@Girgias the output is certainly incorrect (passowrd vs. password); copy&paste is hard
 
@cmb Yeah, I'll just remember not to give opinions in my answers >_>
 
10:54 PM
@Girgias "whack semantics" sounds like the name of a podcast about cricket
 
@DaveRandom I'd tell you we should start it then, but I don't really know cricket :/
 
me either, maybe that could be our USP
although afaict the whole point of cricket is getting drunk in a field, I've got that down pretty well at this point
 
@Girgias could be worse.....you could allegedly maintain a software project where all of the problems are apparently unsearchable, and so the majority of support you do is only useful to one person, and a lot of them neither upvote or accept the answer.
 
00:00 - 23:0023:00 - 00:00

« first day (3686 days earlier)      last day (1255 days later) »