fightbulc / moment.php

Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js
Other
973 stars 154 forks source link

Moving to 2.0.0 #215

Open fightbulc opened 1 year ago

fightbulc commented 1 year ago

@ConnerAiken lets have a discussion here to see what needs to be done to ship version 2.0.0. Looking forward.

ConnerAiken commented 1 year ago

@fightbulc As i've been documenting changes for our company's PHP7 -> PHP8 upgrade - it appears to me that we are fully compatible for PHP 7.4 and above. However, PHP 6 and below is not looking too great.

209 introduces two major changes:

I have not tested it yet, but I would think it would cause a syntax error for PHP 6 and below.

ConnerAiken commented 1 year ago

One issue i've uncovered with PHP 8 compatibility, we may want to extend the valid checks (isValidDate()) of input to the package or default null parameters to 'now'.

DateTime: :__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in moment/src/Moment.php on line 196
<?php
var_dump(new DateTime(null));
?>

image

fightbulc commented 1 year ago

Hey @ConnerAiken,

I would make a hard cut all versions before php 8. I would keep it around as a fixable version but I would put a hold on further development. Hence, lets branch away from master to create a php-8 branch and lets see what needs to be done to make it pass.

How much time do you have to work on this project?

Greetings Tino

ConnerAiken commented 1 year ago

Hey @ConnerAiken,

I would make a hard cut all versions before php 8. I would keep it around as a fixable version but I would put a hold on further development. Hence, lets branch away from master to create a php-8 branch and lets see what needs to be done to make it pass.

How much time do you have to work on this project?

Greetings

Tino

I have a few hours a week. Ok, all the changes should be php 7.4+ compatible but we could do that. If I understand right - master is "fixable"?