3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('ICL_LANGUAGE_CODE', 'en'); function the_title($str1, $str2) { echo $str1 . "House Sitting Days" . $str2; } $json = '{ "house_sitting_date_current_month": ["2020-02-01", "2020-02-02", "2020-02-03", "2020-02-04", "2020-02-05", "2020-02-06"], "house_sitting_date_yes_no_current_month": ["yes", "nada", "nada", "nada", "yes", "yes"], "house_sitting_date_next_month": ["2020-03-01", "2020-03-02", "2020-03-03", "2020-03-04", "2020-03-05", "2020-03-06"], "house_sitting_date_yes_no_next_month": ["no", "yes", "yes", "nada", "nada", "nada"], "toggle_status": null }'; $data_house = json_decode($json); $date = date("Y-m-d"); $sitting_day_str_en = "Sitting day"; $not_a_sitting_day_str_en ="Not a Sitting Day"; if (($k = array_search($date, $data_house->house_sitting_date_current_month)) !== false) { $sitting = $data_house->house_sitting_date_yes_no_current_month[$k]; $sitting_str_en = $sitting == 'yes' ? $sitting_day_str_en : ($sitting == 'no' ? $not_a_sitting_day_str_en : ''); } elseif (($k = array_search($date, $data_house->house_sitting_date_next_month)) !== false) { $sitting = $data_house->house_sitting_date_yes_no_next_month[$k]; $sitting_str_en = $sitting == 'yes' ? $sitting_day_str_en : ($sitting == 'no' ? $not_a_sitting_day_str_en : ''); } else { // not found $sitting_str_en = 'No data available'; } ?> <header class="entry-header container"> <?php the_title('<h1 class="entry-title-house">', '</h1>'); ?> <span class="current-date"><?php echo $date ?></span><!-- prints today's date--> // Line B <?php if (ICL_LANGUAGE_CODE == 'en') { ?> <!-- English --> <span class="current-date-answer"><?= $sitting_str_en ?></span> // Line C <?php } ?> </header>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.130.0050.00418.58
8.4.120.0160.00417.70
8.4.110.0120.00820.39
8.4.100.0110.00917.96
8.4.90.0110.01020.51
8.4.80.0160.00418.95
8.4.70.0100.01118.96
8.4.60.0090.01019.01
8.4.50.0110.00919.36
8.4.40.0070.00317.98
8.4.30.0080.00018.59
8.4.20.0120.00917.73
8.4.10.0040.01619.51
8.3.260.0090.00816.92
8.3.250.0110.00719.13
8.3.240.0090.01116.77
8.3.230.0110.00616.63
8.3.220.0120.00619.23
8.3.210.0030.00418.70
8.3.200.0030.00616.70
8.3.190.0080.01118.56
8.3.180.0090.01016.87
8.3.170.0110.00716.68
8.3.160.0150.00316.77
8.3.150.0040.01117.21
8.3.140.0050.00316.61
8.3.130.0060.00318.41
8.3.120.0120.00320.61
8.3.110.0030.00720.94
8.3.100.0060.00324.06
8.3.90.0040.01126.77
8.3.80.0080.00416.73
8.3.70.0180.00318.29
8.3.60.0110.00318.31
8.3.50.0190.00323.66
8.3.40.0070.01418.84
8.3.30.0110.00418.96
8.3.20.0040.00420.98
8.3.10.0080.00023.48
8.3.00.0030.00519.69
8.2.290.0100.00216.93
8.2.280.0080.01018.50
8.2.270.0150.00417.11
8.2.260.0130.00316.99
8.2.250.0130.00616.55
8.2.240.0140.00318.78
8.2.230.0060.00922.58
8.2.220.0060.00337.54
8.2.210.0140.00426.77
8.2.200.0030.00616.63
8.2.190.0070.00716.58
8.2.180.0110.00718.29
8.2.170.0100.01022.96
8.2.160.0070.00721.20
8.2.150.0080.00025.66
8.2.140.0080.00024.66
8.2.130.0000.00926.16
8.2.120.0080.00021.18
8.2.110.0070.00420.99
8.2.100.0030.01017.78
8.2.90.0040.00419.34
8.2.80.0030.00517.97
8.2.70.0080.00017.63
8.2.60.0000.00818.05
8.2.50.0000.00918.07
8.2.40.0000.00918.34
8.2.30.0000.00818.03
8.2.20.0070.00018.20
8.2.10.0040.00419.28
8.2.00.0040.00419.27
8.1.330.0110.00816.30
8.1.320.0050.00617.65
8.1.310.0090.00616.09
8.1.300.0060.00316.15
8.1.290.0090.00030.84
8.1.280.0140.00725.92
8.1.270.0070.00320.74
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00620.80
8.1.230.0040.00820.92
8.1.220.0050.00317.91
8.1.210.0040.00418.77
8.1.200.0030.00617.48
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0040.00418.78
8.1.160.0070.00018.88
8.1.150.0040.00418.98
8.1.140.0030.00320.73
8.1.130.0000.00720.29
8.1.120.0000.00717.61
8.1.110.0000.00717.49
8.1.100.0000.00817.64
8.1.90.0040.00417.61
8.1.80.0080.00017.64
8.1.70.0070.00017.52
8.1.60.0000.00717.73
8.1.50.0030.00517.59
8.1.40.0030.00617.60
8.1.30.0040.00417.63
8.1.20.0000.00917.75
8.1.10.0000.00817.58
8.1.00.0060.00617.59
8.0.300.0030.00718.77
8.0.290.0040.00416.88
8.0.280.0000.00718.53
8.0.270.0030.00518.12
8.0.260.0040.00420.09
8.0.250.0070.00017.14
8.0.240.0060.00317.09
8.0.230.0040.00417.15
8.0.220.0000.00717.07
8.0.210.0070.00016.93
8.0.200.0000.00717.04
8.0.190.0070.00017.05
8.0.180.0070.00016.91
8.0.170.0050.00316.99
8.0.160.0050.00316.95
8.0.150.0090.00016.92
8.0.140.0080.00016.96
8.0.130.0030.00313.36
8.0.120.0000.00716.98
8.0.110.0100.00016.92
8.0.100.0000.00717.02
8.0.90.0000.00816.88
8.0.80.0050.01216.97
8.0.70.0070.00017.04
8.0.60.0050.00316.97
8.0.50.0040.00416.97
8.0.30.0070.01117.16
8.0.20.0110.00717.42
8.0.10.0040.00417.06
8.0.00.0140.01117.06
7.4.330.0000.00415.55
7.4.320.0060.00016.66
7.4.300.0030.00316.69
7.4.290.0070.00016.57
7.4.280.0000.00816.57
7.4.270.0040.00416.48
7.4.260.0000.00513.32
7.4.250.0030.00316.57
7.4.240.0050.00216.59
7.4.230.0000.00716.58
7.4.220.0000.00716.54
7.4.210.0050.01016.55
7.4.200.0000.00716.62
7.4.130.0080.01016.65
7.4.120.0080.00816.70
7.4.110.0130.00716.55
7.4.100.0060.01216.57
7.4.90.0120.00916.53
7.4.80.0100.00919.39
7.4.70.0120.00616.63
7.4.60.0060.01316.63
7.4.50.0070.01216.54
7.4.40.0090.00716.70
7.4.30.0120.00416.53
7.4.20.0120.01116.67
7.4.10.0140.00316.49
7.4.00.0160.00516.61
7.3.330.0000.00716.26
7.3.320.0000.00613.24
7.3.310.0000.00716.45
7.3.300.0030.00316.25
7.3.290.0040.01116.40
7.3.280.0100.01016.47
7.3.260.0040.01416.67
7.3.240.0070.01116.64
7.3.230.0150.00316.64
7.3.210.0030.01416.69
7.3.200.0090.00916.56
7.3.190.0090.00816.56
7.3.180.0130.00316.60
7.3.170.0090.00916.64
7.3.160.0090.01116.52
7.3.150.0050.01116.36
7.3.140.0090.01216.52
7.3.130.0070.01316.40
7.3.120.0070.01216.45
7.3.110.0070.01316.29
7.3.100.0100.00716.50
7.3.90.0100.00716.52
7.3.80.0080.00916.47
7.3.70.0130.00516.38
7.3.60.0080.00916.25
7.3.50.0090.00816.37
7.3.40.0110.00516.45
7.3.30.0050.01216.38
7.3.20.0120.00716.50
7.3.10.0070.01116.45
7.3.00.0070.00916.44
7.2.330.0140.01016.66
7.2.320.0100.00716.87
7.2.310.0130.00416.60
7.2.300.0050.01416.78
7.2.290.0100.00716.83
7.2.280.0130.01016.89
7.2.270.0120.00616.66
7.2.260.0060.01216.86
7.2.250.0130.00716.70
7.2.240.0090.01016.70
7.2.230.0140.00716.69
7.2.220.0110.00616.64
7.2.210.0060.01216.81
7.2.200.0070.01016.59
7.2.190.0090.01116.72
7.2.180.0080.01316.67
7.2.170.0120.00816.54
7.2.160.0080.01016.56
7.2.150.0100.01316.71
7.2.140.0120.00816.73
7.2.130.0100.00916.71
7.2.120.0070.01316.86
7.2.110.0120.00616.66
7.2.100.0120.00916.81
7.2.90.0160.00416.70
7.2.80.0170.00616.76
7.2.70.0080.01116.83
7.2.60.0100.01116.71
7.2.50.0080.01116.75
7.2.40.0070.01316.67
7.2.30.0080.01016.73
7.2.20.0090.00916.66
7.2.10.0060.01216.73
7.2.00.0090.01016.73

preferences:
29.46 ms | 403 KiB | 5 Q