Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags, again

2019-08-07 Thread Mark Randall
IMHO short tag removal has one major thing going for it, consistency, and by extension, predictability. That's it. Is that enough? I'm on the fence. Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: [RFC] Namespace-scoped declares, again

2019-07-30 Thread Mark Randall
isn't it about time that an spl_autoload_list was added that accepted the standard composer classmap [class_id => path] and forewent most autoload callbacks entirely? Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: [RFC] Namespace-scoped declares, again

2019-07-27 Thread Mark Randall
cal directories. Sounds like a job for composer tbh so userland workload would be limited for projects using modern workflows. This would of course be dependent on if the compiler stage has the ability to branch off and call an autoloader the first time it encounters the import_declares. Ju

Re: [PHP-DEV] Re: Generating arginfo from stub files

2019-07-24 Thread Mark Randall
X. Certainly not a catch-all situation, but might present an opportunity for doing some of the leg work automatically. Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: PHP 7.4 FEATURE FREEZE ❄

2019-07-23 Thread Mark Randall
On 23/07/2019 10:00, Derick Rethans wrote: DOs: - Test test test test - Tell your friends and collegues to test with their apps and projects - Oh yeah: test! Derick, congratulations on your RM role, however, for your personal well-being, I feel obliged to ask if you have recently experienced a

Re: [PHP-DEV] [RFC] [DISCUSSION] Deprecate PHP's short open tags V2

2019-07-23 Thread Mark Randall
leaky code. If short tags are to be removed, V2 is a significantly more reasonable way of going about it. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: [RFC] [DISCUSSION] Deprecate PHP's short open tags V2

2019-07-23 Thread Mark Randall
stretching the bounds of reasonableness too far to suggest the creation of a dedicated page on php.net that contains a description, a link to csfixer etc, and then that link be included in the depreciation message itself. -- Mark Randall On 23/07/2019 18:54, G. P. B. wrote: Hello intern

Re: [PHP-DEV] [Discussion] Scalar Object Strings and MultibyteEncodings

2019-06-20 Thread Mark Randall
On 20/06/2019 22:19, Rowan Collins wrote: On 20/06/2019 16:36, Mark Randall wrote: "Hello".substr(1) // would work as expected regardless of encoding As I always point out when "multi-byte support" or "Unicode support" is discussed, it's often ambiguous j

[PHP-DEV] [Discussion] Scalar Object Strings and Multibyte Encodings

2019-06-20 Thread Mark Randall
r the web? function x(utf8_string $x): utf8_string { ... } These are all just questions I have no answer to or firm opinion on, but I would be interested to know people's general ideas as to solutions. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Generating arginfo from stub files

2019-06-18 Thread Mark Randall
ke descriptions or unions with different requirements for each type. Well-docblock'd stubs, C definitions, documentation pages etc would then be the drawn from the JSON rather than the other way. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV][RFC] Alternative "use" syntax for Closures

2019-06-17 Thread Mark Randall
} return -1; }; $x and $y would be captured, $z would not be. I believe this is how short closures are implemented, but is at present only supporting a single line. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: [PATCH] Add configuration value to enable/disable stack tracelogging

2019-06-17 Thread Mark Randall
IMHO would provide best-of-both-worlds. The benefits of public key vs a symmetric key are that the logs remain secure even with read access to php.ini. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV][RFC] Alternative "use" syntax for Closures

2019-06-16 Thread Mark Randall
0; $y = 1; $closure = function() use (...) { }; Where "use (...)" would auto-capture all of the used variables in a similar manner to short closures, that would certainly save a bit of time. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscri

Re: [PHP-DEV] Re: PHP RFC: Nullsafe Calls

2019-06-04 Thread Mark Randall
eing able to tell the difference would have at least some useful applications. Clearly there's ways around that using the current, more verbose method, but it would be nice if a way could be found so that this potential ambiguity wasn't there in the first place if this new mechani

[PHP-DEV] Re: PHP RFC: Nullsafe Calls

2019-06-03 Thread Mark Randall
gt; null; I know this is a huge tangent, I just wanted to throw it out there as a possible option for handling chaining, that would potentially kill many more birds down the road in the process. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: Error instead of returning false

2019-05-07 Thread Mark Randall
tion errors. 4. Leave the existing functions as-is, finally claim the \php namespace, alias all of the internal functions into it, and make their default, unchangeable behaviour be to throw a RuntimeException on error. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To uns

[PHP-DEV] Re: Proposal for a RFC

2019-05-04 Thread Mark Randall
#x27;, MyObject::class ]; } } Eh, my suggestion is probably a terrible ideal. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-30 Thread Mark Randall
rd his proposals as an RFC with all due haste, as it's quite clear the current plan cannot go forward as-is. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: Alternative approach to short tags deprecation

2019-04-25 Thread Mark Randall
eir entire codebase against each one. But we all know that's not how the real world works. For all those reasons, I am in favour of your proposal to fail-safe with a compiler error. (Also: Did I miss a vote option which would have made short_open_tags always on?) -- Mark Randall -- PHP

Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Mark Randall
s *significant*. Until someone can convince me otherwise, I will continue to strongly believe that foreseeable future (years). I'm half tempted to RFC it so it can go to a vote. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Mark Randall
ary of would be if you were computer-generating code, as it would not pick up literals. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] [VOTE] Deprecate PHP's short open tags

2019-04-24 Thread Mark Randall
t holds no weight with me. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Object Type Casting Reloaded

2019-04-23 Thread Mark Randall
On 23/04/2019 14:39, Mark Randall wrote: It keeps coming back to the feature we've all been praying to the PHP Gods for... generics. Replying to myself (sorry). I just wanted to point out that the same syntax would also solve your other issue from the nullable casts thread: function

Re: [PHP-DEV] Object Type Casting Reloaded

2019-04-23 Thread Mark Randall
$obj; } throw new InvalidArgumentException('Cast expected ' . T); } $x = cast($obj); -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Permit trailing whitespace in numeric strings

2019-04-14 Thread Mark Randall
ll replace it as the recommended inbuilt method that handles strings with whitespace and trailing junk? Will there be one? I'm aware that the most common IDEs suggest using (int) instead of intval. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscri

Re: [PHP-DEV] [RFC] Nullable Casting

2019-04-11 Thread Mark Randall
of whether it passes or fails, you should both be holding your heads high that you've made the effort. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Nullable Casting

2019-04-10 Thread Mark Randall
on and returns null. Otherwise moves on to next option and casts it to an integer. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Nullable Casting

2019-04-10 Thread Mark Randall
tems'); } $value = (?string)$_GET['name'] ?? ''; if ($value === '') { // also, ?name[]= can sod off throw new Exception('You must provide a name'); } -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Nullable Casting

2019-04-10 Thread Mark Randall
ll I don't think it would go down very well to have non-nullable casts throwing TypeErrors for common cases, without an elegant could-not-convert fallback that doesn't require a 5 line try-catch block. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscr

Re: [PHP-DEV] [RFC] Nullable Casting

2019-04-10 Thread Mark Randall
hen prints `int(1)` In the absense of a nullable modifier, that makes so little sense that it definitely needs to throw a TypeError IMO. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Nullable Casting

2019-04-10 Thread Mark Randall
e ?? $default. Equally I see a lot of use in the following to nullify unexpected inputs such as if $_GET['something'] was an array: $input = (?string)$_GET['input'] ?? ''; -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Permit trailing whitespace in numeric strings

2019-04-10 Thread Mark Randall
out, it would allow: $output = (?int)$input ?? $default; -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: [RFC] Namespace-scoped declares, again

2017-12-11 Thread Mark Randall
set of independent scripts. If this doesn't pass, long term I think the main alternative would be to have a single statement that was like a quasi-include of declarations in another file, almost like a ".h" declare_import('/my/namespace/nsprefs.php'); -- Mark Randal

Re: [PHP-DEV] RFC - Array Of for PHP 7

2017-11-02 Thread Mark Randall
al = &$t1[1]; $val = 1; -> [ 'hello', 1] I did take a look in zend_types.h half expecting to see a pointer to an optional structure defining an indirect function call + argument to be called whenever the zval_value was about to be changed, but if it's in there, I mis

Re: [PHP-DEV] RFC - Array Of for PHP 7

2017-11-02 Thread Mark Randall
n generics, casting operators, and overloaded function constructors... ... and yes, that did include almost every major language wishlist item in a single go. Chalk it up to me romancing my long lost love of C++. Thanks. -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Suggestion Method Constant

2017-10-13 Thread Mark Randall
3'); chain( 'Random String', func_1($1, 'Hello', 'World'), func_2($1, 'Peace', 'Out'), func_3('ThisOneNeeds', 'Arg3ReplacingInstead', $1), func_3($1, $1, 'HowAboutOneWhichUsesTheSameArgumentTwice') );

Re: [PHP-DEV] Suggestion Method Constant

2017-10-13 Thread Mark Randall
7;Hello', 'World'), func_2($1, 'Peace', 'Out'), func_3('ThisOneNeeds', 'Arg3ReplacingInstead', $1), func_3($1, $1, 'HowAboutOneWhichUsesTheSameArgumentTwice') ); function chain($start, ... $fns) { foreach ($fns as $fncall) { $start = $fncall($start); } return $start; } -- Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

<    1   2   3