« first day (3659 days earlier)      last day (1272 days later) » 

12:15 AM
I spend a lot of money on food because it's part of life I really enjoy. It's not eating out much either; fresh vegetables, seafood, nuts and seeds, etc.
Even when salmon is on sale it's still very pricey compared to beans (which I do still eat sometimes with tacos, fajitas, etc).
 
12:32 AM
@LeviMorrison what kind of beans are you buying? o_O
A can of black beans is like 2-3 dollars
 
Cheaper here; like $1
Salmon will be more like $10 (on sale)
 
Ill, do grilled salmon with asparagus from time to time.
 
1:22 AM
@LeviMorrison oh, I read that wrong. I thought you said the beans cost more than salmon.
Hence my confused reaction
 
1:34 AM
They do if you catch the salmon yourself, but you buy the beans
J'accuse!
 
@Sara don't know if you know but, you can automatically close a PR when commiting if you add "Closes GH-XXXX" at the end of your commit message
 
I did know that, but I also forget easily. :p
 
Right :p
 
@Crell The powers that be say we're a go, let's pick a Friday in November that isn't a national holiday?
 
@Sara are you looking at doing some more resource to object conversion? Or did you just merge the ones you did because we finally branched 8.0?
 
1:50 AM
evening
 
 
2 hours later…
3:26 AM
Would it be bad practice to create exceptions but not throw them? For example, if someone makes a request and gets a non-200 code back (or with GraphQL a 200 code with an error response). The client wouldn't throw an exception, but the user could do $client->getError() and get the exception object
I've never seen it done before so naturally I think I wanna stay away from it but it would be useful
 
Hi
In this example, I did not understand why 4 value is ignored
https://3v4l.org/PDLk5
Any idea?
 
Well that's an exception not being thrown
 
@Alesana my preference in this scenario is to somewhat follow the PDO approach (albeit probably with a default of on), where you offer an option on whether to throw exceptions or not
I use it very much as you describe: a "http request" class that can, if desired, throw an exception on a 4xx/5xx response.
 
@Stephen I was thinking about that one, for some exceptions. PSR-18 is pretty clear about not throwing an exception for well formed error responses though
 
also to nitpick, you shouldn't treat 3xx responses as errors.
@Alesana I have just south of zero time for the circle-jerk of bullshit that comes out of FIG.
 
3:36 AM
@Stephen Ah yeah I guess I mean 4xx and 5xx mainly
I don't blame you, but I definitely see the benefits of using their interface PSR's - whether you agree with how they're designed or not. It is convenient for compatibility with packages you don't even know exist
 
<rant> The whole 'we must make all our code look exactly the same' approach in the early PSRs was pretty on the nose, but the one (that I noticed, I don't really follow them) that really proved to me that they've no idea what the fuck they're doing, is a logging standard, that insists on using syslog NAMES, not syslog LEVELS.
@Alesana if you want that compatibility I would write your class as it makes sense, and provide a wrapper class to adapt to their ridiculous bullshit, if you want to support it.
 
Yeah I've seen a lot of that. Anyways, I'm not actually writing a PSR-18 compatible client but instead removing the hard dependency on Guzzle for a PSR-18 compatible client
So there's no reason I couldn't throw exceptions for 4xx and 5xx, but I'd rather let the end user be able to configure their client to do that
Since it's a GraphQL client wrapper it would make sense to let them configure our package to throw an exception on graphql specific 200 response errors though
 
@Alesana I tried to find some discussion about why they think exceptions shouldn't be thrown, and gave up when I found yet another case of "hey guys I know it's stupid but we're gonna hobble our fancy new 'standard' because of something in some existing library".
PSRs on the whole seem very much to be just "standardising" the ridiculous wtf-why-do-we-do-this glue code that comes with any project with a significant number of third party inclusions.
@Alesana if your package isn't claiming to be psr-18, then what they say is irrelevant. in your scenario with those goals I'd recommend two options the caller can set: one to throw exceptions on http errors (4xx and 5xx) and one to throw exceptions on graphql errors. possibly a shorthand option to set both at once.
 
3:59 AM
I can kind of understand not throwing exceptions. I think originally they wanted to allow it but not force it
But then if you wanna implement the interface you kinda have to know whether you should check the response code or check for an exception (which is pretty similar to a conversation I had not too long ago while deciding how to implement it)
Anyways, that's not a bad idea. I'm wondering what standard practices for displaying errors without throwing exceptions is though. Do you just associate a code and a message with each different type of error?
I like the idea of defining my errors as classes
@Exception The array_merge is irrelevant. You're overwriting your indexes
 
4:18 AM
@Alesana depends a lot on the context. e.g. for http errors, I'd just use the standard http error code + error message; for graphql errors I assume they return an error code or message (or both). I'd imagine it's useful to have separate HTTPError and GraphQLError exception types.
@Alesana this is one reason why I wish php had a specific syntax to indicate which exceptions a method throws - maybe with annotations it'll be easier to add this type of optional stuff into core.
 
 
3 hours later…
7:35 AM
\o
 
7:54 AM
o/
 
\o
 
Wes
8:28 AM
anyone knows how to extract thumbnails from mp4 files? ffmpeg or something?
 
HTML string containing ASCII character \0 breaks DomDocument ・ DOM XML related ・ #80268
Incident on 2020-10-22 08:32 UTC ・ GitHub Pages has Partial Outage
 
@Sara Bike-shed: FTPConnection or FtpConnection? :P
 
Wes
@NikiC pls FTP :P
 
@Wes pls Ftp
 
Wes
8:43 AM
@mega6382 yep i was already looking into that :D
 
Ftp seems better
 
@mega6382 Let me just connect to my Ftp server.
 
FTP
@Wes I do
 
Wes
:D ffmpeg did it
 
ffmpeg -i $1 -vframes 1 -an -ss 0 $1.png

Gets the first frame (the `1`) from the video and stores it in a png
 
8:56 AM
@NikiC FTPConnection - keep it consistent with eg PDOStatement
 
@Sjon And GdImage, right? :P
 
@NikiC yeah - I was afraid there'd already be inconsistencies. Let's "fix" those for PHP9 ;)
 
OpenSSL sets Subject wrong with extraattribs parameter ・ OpenSSL related ・ #80269
 
cmb
@NikiC public FTPConnection $fTPConnection ;)
 
@cmb $ftpcONNECTION
 
cmb
9:07 AM
My point is that it would be nice to just lower-case the first character of class name to get a nice variable name.
 
PHP isn't GO :-þ
Another day, another timezonedb release.
 
@cmb doesn't everyone just write public FTPConnection $ftp;? or who writes that out in a property name?
 
People that write modern software in a PHP that uses typed properties are not likely to use FTP?
 
@NikiC I'm also a pro-FtpConnection! :D P.S. Are the GdFont|int types right?
 
whatever, put SSH in there
 
cmb
9:12 AM
Same issue with $fTP
 
How does it even matter, isn't this case insensitive anyway?
 
@MateKocsis Apparently yes
 
@Derick not so much in PHP core I guess, but it does matter in class loading for composer on case sensitive filesystems for example
 
There are a bunch of predefined fonts that are represented as integers :(
 
All issues have been resolved!
 
9:15 AM
@bwoebi Right, but this is a built-in type that doesn't trigger autoloading
 
cmb
@NikiC that stuff is terrible legacy, and we should consider to deprecate it.
all these predefined fonts are encoded as ISO-8859-2, btw
 
They're uber handy if you don't have freetype support on small devices though.
 
@MateKocsis It needs a fix to use the right zpp for gdfont|int though...
 
@NikiC Yes, that's what I wanted to refer to :)
 
@cmb It looks like ext/imap/tests/bug77020.phpt segfaults when executed twice in the same process
Noticed in github.com/php/php-src/pull/6365, but can probably be reproduced by running it in the cli server as well
 
cmb
9:27 AM
@NikiC I'll have a look ASAP.
 
@SalOrozco I'm definitely mankini-body ready
 
cmb
@Derick they're not antialiased and look terrible. And also, aren't you the one who wants to drop 32bit support? :p
 
32bit windows binaries, yes
 
morning
 
cmb
@Derick ah, binaries – okay. :) I'm also okay with keeping GdFont; at least it is a class now.
 
9:40 AM
Didn't I see that MSFT is phasing out 32bit windows anyway?
 
@DaveRandom hola
@Wes i don't code anymore but memories of good time i had here back in 2012-15 makes me come here.
 
cmb
@Derick that would be a surprise. AFAIK, 32bit is still the prefered platform for MSVC (e.g. x86 has ASAN support, x64 not yet)
 
10:03 AM
@Danack can you explain to your townspeople that the idea of road naming is to give all the roads different names, it doesn't work when you call them all the same thing google.com/maps/place/Hallen,+Bristol+BS10+7SD/…
and fyi, I know I say this a lot, but I think I really genuinely am going to be in Bristol tomorrow
 
GoogleMaps has such typical American bias. "Rd Two" instead of "Road Two" and "Central Ave" instead of "Central Avenue". These things are not something a Brit would shorten.
 
@DaveRandom how was the ass o'clock meeting?
@Derick Blvd => Boulevard
 
I know. Nobody shortens these here
 
10:22 AM
I'm so used to the shortened versions that the fully spelled out versions look genuinely weird. Even the street I live on, I abbreviate it to "St." all the time.
 
@Tiffany I don't really remember, I was asleep because it was 6am
 
I really should wait for the caffeine to kick in before talking in a chatroom. 😅
 
I mean I was vertical and physically there
I was not really conscious though
 
It's almost 5:30 now and I'm partially conscious. I made sure to be asleep before 10:00 pm though (or 22:00)
Though, in fairness, what motivated me to wake up when my alarm went off was the prospect of a morning smoothie, but the place doesn't open for an hour and a half...
 
10:45 AM
That is nice, I live in a village, you can milk a cow as soon as you wake up at 5:30.
 
I live in a town, you can buy milk at 2.47am in your pyjamas if you want, it's great
or heroin
 
Or potato in my case.
 
@DaveRandom ಠ_ಠ
 
@DejanMarjanović nah too much for me that shit, I stick to the soft stuff
 
No cake for you?
 
10:49 AM
You can get high by sniffing manure @DaveRandom
 
@Tiffany not into dem yellow bentines
you don't want none of that shit. cake is a made-up drug, those are the worst ones.
@DejanMarjanović maybe later
 
11:03 AM
php -r 'phpinfo()'
PHP Parse error:  syntax error, unexpected end of file in Command line code on line 1

Parse error: syntax error, unexpected end of file in Command line code on line 1
Is the ; really needed here?
 
yeh it needs the ;
iirc an explicit ?> has an implicit ; but it needs one or the other
you'd have to ask Nikita or Bob etc about the specifics of why that is
 
@DaveRandom No, I have neither the patience, or the crayons, to achieve that.
@Alesana Your question is kind of weird in an x/y way. It makes the assumption that errors should be represented as exceptions....but what your really asking is 'is it okay to not use exceptions for logic flow'. And the answer to that is yes. If you're only going to use that library yourself, that's fine to change the behaviour of when exceptions are thrown.
If you're making that library for other people to use, I'd suggest adding other methods, with different names, for the changed functionality, and still throw exceptions like the standard implementations do for the original methods.
 
11:18 AM
@DejanMarjanović every expression needs to end in a ; - an EOF is not emitting a ;, while a ?> leads to the lexer emitting a ;
there's no particular reason why we couldn't make EOF make emitting an ;
just … it does not currently
 
11:43 AM
@bwoebi I must say I would really like it if that was done, if only for that specific case of running a single statement on the command line
it might also be nice to omit it from a file that is just <?php require __DIR__ . '/../main.php'
not really bothered about that though
don't think it would have any other sane use case
 
Thanks Bobby and Davey boy. Does it require RFC or something?
 
oh it would be nicer for eval() as well
@DejanMarjanović it would yes, and I think it would prob require 2/3rds, I think that would count as a language change
I don't think it would be all that controversial though, as long as there is no perf impact (presumably not) and it's fully backward compatible (presumably so)
 
cmb
all RFC require supermajority for quite a while now :)
 
oh
good
I haven't been paying much attention to internals, mostly just reading RFCs and voting based on their actual merits
odd concept, I know
 
@DaveRandom RFC @bwoebi PR @DejanMarjanovic Nothing
Sounds like a plan.
 
12:20 PM
@DaveRandom I do like absolutely not oppose :-)
 
cmb
12:47 PM
@NikiC no need to run twice, not related to OPcache, but rather github.com/php/php-src/commit/…, in combination with a test that is supposed to check for a segfault, but ends with %A :)
 
@cmb ... duh
%A strikes again
 
cmb
echo "done\n;"
 
ouch that's my commit
 
cmb
1:08 PM
np, but could you please fix it :)
 
Let me catch up on a lecture and I'll be on it :)
 
cmb
no hurry :)
 
1:32 PM
no. hurry!
 
number hurry?
 
#hurry
 
1:53 PM
Niki: Thanks for the fixups on my conversions.
Would not have expected Z_PARAM_OBJ_OF_CLASS_OR_LONG to be a thing that existed o.O
 
@Sara It's new in PHP 8.0.
I don't see any uses of it though
 
I'm afraid to look and find out how many combinations there are.
 
@Sara gmp?
 
gmp is string|GMP, no?
 
oh I guess yeh
weird
some sort of enum-like thing?
clutching at some pretty thin straws
 
1:59 PM
I'll just sit here smugly and know that a c++ template would cover this kind of thing better.
 
/me smiles and nods politely
 
dns_get_record returns duplicates and unexpected output ・ Network related ・ #80270
 
@Sara Not as easily as you might think :)
The reason we have these is to make sure argument handling is consistent with union type semantics ... you know, all that fun "weak types" stuff
 
Maybe we should subscribe to survival of the fittest and get rid of weak types?
 
2:20 PM
I think weak types are still going pretty strong - I guess we shall select strict types away again
 
weak types can die in a fire
@NikiC Even with weak types, don't things get coerced?
Or is that done in RECV_* for userspace meaning we have to do it in ZPP for internals?
 
@Sara yes
 
cmb
3:01 PM
@Girgias, thanks for fixing that imap_mail() segfault! I assume that the test fails on Windows, though, see github.com/php/php-src/commit/…
 
Erf... will see if CI passes because that commit changes '%s' to '%A' and I'm changing it back to '%S' which also accepts no char
 
cmb
output on Windows (default settings):
Warning: imap_mail(): No message string in mail command in C:\php-sdk\phpdev\vs16\x64\php-src-8.0\ext\imap\tests\bug77020.php on line 2

Warning: imap_mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\php-sdk\phpdev\vs16\x64\php-src-8.0\ext\imap\tests\bug77020.php on line 2
There is the additional empty line above the 2nd warning.
And if we'd set sendmai_from in INI section:
Warning: imap_mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\php-sdk\phpdev\vs16\x64\php-src-8.0\ext\imap\tests\bug77020.php on line 2
But if we set sendmail_path in INI section, we'd get the same error, because imap_mail() doesn't heed that setting (and always uses SMTP on Windows)
 
Right... I'll have a look at this again, currently fixing something else in IMAP
 
cmb
3:47 PM
ta
 
@cmb @NikiC the reproducible here doesn't seem to work: bugs.php.net/bug.php?id=76618 but the code hasn't been changed, I'm only testing on master currently as I want to poke CI before rebasing it onto 7.3
 
prepare json_set throw exception on mysql 8.0.22 ・ PDO MySQL ・ #80271
 
cmb
@Girgias I haven't been able to reproduce this on Windows, too, but I think Kalle's fix can be applied without regression test.
 
Welp let's go then
 
cmb
@Jeeves are plain strings valid JSON for MySQL?
 
4:02 PM
@crell A couple clarifications: Does pSH offer MongoDB as a service? If so, what versions?
 
@Sara not as a service, no. we're currently in discussion with them to be able to offer 4+.
 
@FlorianMargaine Do you know who you're talking with?
((btw, I'm working at MongoDB currently))
 
@Sara idk about your whereabouts those days :P
 
I meant with whom at MongoDB is pSH negotiating.
 
yeah, we've been discussing with some of your coworkers lately in order to clarify our stance w.r.t. the SSPL
let me check
 
4:05 PM
But I did reread that and now I'm laughing. :D
 
do you have a private channel to discuss this? I'd rather not leak names.
 
Fair... let me figure out how to do that...
 
lazy PhpStorm question: I have multiple folders that are separate git repositories. The folders themselves would likely be opened as separate projects. If a class is defined in one project, how can I make PhpStorm recognize the class definition in another project?
(trying to make a case to allow usage for PhpStorm over Eclipse, and that's a hurdle, currently, because Eclipse allows opening multiple folders in one project, but that's also a problem because workspaces -_-)
if I opened the containing folder for all of the folders, would that work around it?
 
@Tiffany mostly.
 
Would that fuck up code navigation as multiple instance of a lot of stuff will be found?
 
4:17 PM
there would be some annoying bits, like it might not know how to handle multiple composer.json files that are not in the root....but possibly you aren't using that anyway.
 
@PeeHaa namespaces :)
 
@Tiffany namespaces of what?
 
I guess I misunderstand what you mean by multiple instances?
 
You do not use 3rd pary deps like phpunit in all repos?
 
not really
 
4:18 PM
@PeeHaa why would there be duplication of stuff? they probably aren't doing 'composer installs'....
 
composer usage is very, very limited
I think phpunit is one of the only libraries we use, honestly
there may be one or two others
 
and most tools can be run as phars.
 
4:33 PM
shove it up your phars
 
@Tiffany I had a very similar scenario just the other week, and added the other project as an "additional include path", as described here: jetbrains.com/help/phpstorm/configuring-include-paths.html
I think it's intended for things like PEAR modules or whatever where you have a central "library" dir, but it worked fine just pointing it at the class root inside another checked out project
 
4:49 PM
Array ( [@type] => xsd:string [#text] => assigned_user_name )

How to access #text .. I have converted xml into a json and then into array
 
@IMSoP cool, thanks, I'll have a look at this and try it out
 
@Exception step 1: don't convert XML into JSON and into an array; step 2: see php.net/manual/en/simplexml.examples-basic.php
if it's too late to fix that mess, it doesn't matter where it came from, you have an array, so you access keys of it like any other array: $foo['#text']
 
I want to loop through it and then collect inner elements in array for later use
 
$sx = simplexml_load_string($xml); foreach($sx->whatever->blah as $item) { $my_array[] = (string)$item; }
SimpleXML isn't perfect, but it's a lot better than anything you'll build by hacking the whole document into an array
 
5:05 PM
Is there a way in config.m4 that I can detect if PHP has been compiled in debug mode?
 
@Exception any reason why it has to be an array instead of using a class built for XML?
It doesn't bite, I promise
 
@Trowski I'm curious why you want to know?
 
@LeviMorrison Fibers require some special support for Valgrind, but I want to make compiling that in as optional. I was thinking of having the switch depend on if PHP was compiled with --enable-debug.
Otherwise I can just add a --enable-valgrind switch on configure.
 
I think I would do the latter.
 
@Exception If you want to find specific elements in an XML document you may want to look at XPath ( php.net/DomXPath )
 
5:08 PM
Ok
 
@Trowski you can use the flag '#if PHP_DEBUG' ? Or does it involve setting linker options?
 
there already is HAVE_VALGRIND just for that
 
@AllenJB FYI, you can use XPath with SimpleXML as well: php.net/manual/en/simplexmlelement.xpath.php (I'm slightly obsessed with SimpleXML, mostly because I hate how verbose it is to do anything with DOM)
 
@bwoebi Perfect. Can I use that somehow in my own config.m4, or do I have to add the PHP_ARG_WITH bit?
 
@Trowski unnecessary, you just include php_config.h (which I guess you anyway indirectly include via some other header file)
at least I guess you want to just reuse the flag if php itself was also compiled with valgrind?
 
5:16 PM
And then it should be available as a macro to be used like - heap.space/xref/php-src/sapi/cgi/cgi_main.c?r=c97da0f8#2243
 
Cool, that's even better.
 
....but on the other hand, maybe that would be annoying, and having it be separate from the PHP setting might be better.
Well, someone can ask for that as a feature.
 
Eh… yeah, I can always add it again. Using HAVE_VALGRIND worked exactly as I wanted.
Any idea why when I run tests with TEST_PHP_ARGS=-m I always get a .mem file with:
--49774-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option
--49774-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 2 times)
 
@DaveRandom lol
 
@Trowski sounds like macos? valgrind has always been a bit finnicky there
you can just ignore these really
 
5:25 PM
@Jeeves I can't reproduce this one. Works for me on the specified versions as well as MariaDB and PHP 7.3
 
@bwoebi Ok, that's fine. It's obvious yet if a test fails as the file gets a lot bigger, but it does add a step.
 
Valgrind didn't work on Mac OS pretty recently; is it working again?
I always just do asan builds on Mac instead.
 
@Trowski yo dawg, we heard you like coding and bugs....so we put a bug in your debugger, so you can debug while debugging.
> Temporarily disable extra MACH_SEND_TRAILER checks
seems to have not worked, or your version doesn't have that change?
 
@Danack haha, didn't see that. Based on the commit time, pretty sure I do.
 
5:30 PM
Well, sounds like the right place to open an issue, or to apply a similar hack.
 
Think I'll open an issue. I don't feel like debugging my debugger. :-P
 
@Danack This is my life.
 
6:05 PM
@Danack It's a library that other people are using. So I would normally agree that the general methods should throw exceptions but since we're transitioning into using a PSR-18 interface instead of a hard dependency I'm not quite sure. So PSR-18 says that the client must not throw exceptions for 4xx and 5xx responses, but Guzzle 7 is PSR-18 compliant and can be set to throw exceptions
So a user can pass in a Guzzle 7 instance that is configured to throw HTTP errors or that doesn't. So by default, a user can already choose
But they JUST pass the client in and don't have access to it from there. So I want to add a way for them to use our wrapper to see the errors that are present without the exceptions being thrown.
And then this is a GraphQL client wrapper so the other scenario which isn't handled by the HTTP client is a 200 response with an error in the body (eg. GraphQL syntax errors). Currently we throw an exception for that, but since we're using an implementation that doesn't throw HTTP errors I feel like we should do the same thing with the 200 response errors
 
then probably do whatever is easiest for now...as it sounds like whatever you choose is likely to be wrong...
 
haha no right answer? :p
 
6:44 PM
Lorenzoaxora ・ *General Issues ・ #80272
 
 
2 hours later…
8:34 PM
crickets
 
9:04 PM
chirps
 
Hey guys, I hope you can help me with this question.
I got no Idea why it doesn't work and been spending over 20 hours on it..

https://wordpress.stackexchange.com/questions/376979/woocommerce-add-product-gallery-images-doesnt-show-upload-screen
 
9:20 PM
Sounds like Javascript issue @YotamDahan
 
9:31 PM
@Crell Errata on the latest article for Platform.sh,
"When comparing a string to an integer, the integer will be converted to a string and then compared rather than the string being converted to an integer. That’s true for == checks as well as for greater-than and less-than checks."
This is incorrect, the string will be converted to an integer if and only if the string is numeric, otherwise the integer gets converted to a string for the comparison (more important for >/<)
See: https://3v4l.org/fcLPJ
Also var_dump((int) "25foo"); will give you int(25)
Which probably deserves a mention somewhere that leading numeric strings are still kinda a thing ATM for BC
Also this line
> 42 == '42 '; // false
is also incorrect, this returns true in PHP 7
 
9:54 PM
@DejanMarjanović you are so correct!! Thank you very much
One of my scripts somehow got currpted
 
Didn't do nuffin but glad it help :)
 
10:17 PM
@Girgias Well hmph. Let me try and get that updated, hang on.
 
@Crell Sure, it is “totally bonkers.” so hard to get all the rules correctly :D
 
True dat.
 
The case with "42 " is false is if you pass it to is_numeric()
Or you get a E_NOTICE when using it
The matrix of possibilities is just über complicated
 
I didn't want to get into too deep detail here.
 
Right, and obviously
I still haven't recuperated my sanity after wrapping my head around PHP's behaviour
 
10:21 PM
* Numeric strings are treated and defined consistently in all cases.
* When a numeric string is compared to an integer, with == or greater-than/less-than, the string is converted to an integer and then they're compared.
* When a non-numeric string is compared to an integer, the integer is converted to a string and then they are compared as strings.


Accurate?
 
Accurate :)
 
That then renders this incorrect, no?

* Non-numeric strings are not equal to a number, ever. No more `0 == "seriously, what?"`. Trying to pass a non-numeric string to a function that expects a number will now throw a TypeError.
 
Well the 0 == "string" is evaluated to false
but was evaluated to true in PHP 7
 
Ah, so non-numeric-leading strings is what I should say.
 
And the latter part is also true, passing "2foo" in weak typing mode to an int param throws a TypeError
Just explicit casting still "understands" leading numeric strings
 
10:25 PM
New bullet list:

* "numeric strings" are now any string containing all numeric values with leading or trailing whitespace, which can be safely ignored, rather than just leading whitespace. (Note that "numeric values" can include exponents and a dot, such as `"42.5e4"`, not just numerals.)
* Numeric strings are treated and defined consistently in all cases.
* When a numeric string is compared to an integer, with == or greater-than/less-than, the string is converted to an integer and then they're compared as integers.
 
Hopefully this explains it: 3v4l.org/NN7md
 
Valid?
 
Yup
As I can't think of any other case where leading numeric strings exist
Well... maybe string indexes...
Indeed:
$string = "hello world";
var_dump($string["4b"]);
Will output:
Warning: Illegal string offset "4b" in /in/4jF0N on line 4
string(1) "o"

But that's an edge case of an edge case
again done for BC reasons...
 
That's always been a bug so I'mma ignore that. :-)
 
Well it did the notice thing before
That's why it didn't go straight to TypeError, but that's because handling of string offsets was whack
 
10:32 PM
Evening folks
 
10:56 PM
Is this a good idea or should I use property instead? 3v4l.org/aMScX
 
@Dharman why are you using inheritance for that?
 
I need a flag for the parent class that will output a slightly different value.
I don't need to redefine the method chain, I just set a flag and the parent method produces slightly altered value
 
could you solve it without using inheritance?
 
I don't see a better way. If I don't redefine a flag then I need to redefine a constructor which is worse in my opinion
 
@Dharman sandimetz.com/blog/2016/1/20/the-wrong-abstraction or you could just a trait to duplicate the constructor.
 
11:14 PM
Ok, I will take that into consideration, but I really should release an update by the end of the week, and I already have too much work to do.
Refactoring is nice, but it's also time-demanding.
 
5 hours ago, by Danack
then probably do whatever is easiest for now...as it sounds like whatever you choose is likely to be wrong...
 
Jpv
11:59 PM
Hey guys. quick question.. on a if / else , lets say that your logic met the If criteria. but somewhere on the code, you want to return the same thing as the else statement. is there anyway to tell php, break, and default to the else statement?
 

« first day (3659 days earlier)      last day (1272 days later) »