回答編集履歴

2

変数名変更

2020/06/30 10:47

投稿

bainary
bainary

スコア58

test CHANGED
@@ -1,14 +1,14 @@
1
1
  ```php
2
2
 
3
- $get_contract_date = new DateTime('2020-01-01');
3
+ $get_date = new DateTime('2020-01-01');
4
4
 
5
- $end_contract_date = new DateTime('2025-01-01');
5
+ $end_date = new DateTime('2025-01-01');
6
6
 
7
7
  $date = date('2020-01-01');
8
8
 
9
9
  $year = intval($data['date']);
10
10
 
11
- $get_year_number = $get_contract_date->diff($end_contract_date);
11
+ $get_year_number = $get_date->diff($end_date);
12
12
 
13
13
  $encode_year = $get_year_number->y;
14
14
 

1

変数ミス変更

2020/06/30 10:47

投稿

bainary
bainary

スコア58

test CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  $year = intval($data['date']);
10
10
 
11
- $get_year_number = $data['get_contract_date']->diff($data['end_contract_date']);
11
+ $get_year_number = $get_contract_date->diff($end_contract_date);
12
12
 
13
13
  $encode_year = $get_year_number->y;
14
14