3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tz_string = 'Europe/Paris'; $timezone_utc = timezone_open('UTC'); $timezone = timezone_open($tz_string); //$lasttimestamp = time(); //$lasttimestamp = 1743296400; //$lasttimestamp = 1729990800; //$lasttimestamp = 4141328400; $lasttimestamp = 4160077200; $lasttimestamp2 = '' . $lasttimestamp; $to_min = strtr($lasttimestamp2, array('-2147483648' => '-2147483647', '-2147483647' => '-2147483647', '2147483647' => '2147483646')); $to_min = (int) $to_min; $to_min = '' . $to_min; $to_min = strtr($to_min, array('-2147483648' => '2147483647')); $to_min = (int) $to_min; $from_max = 2147483647; $to_min2 = 2147483647; if($to_min > 2147483647 || -2147483648 > $to_min) { $from_max = '2147483648'; $from_max = (int) $from_max; } elseif($to_min < 2147483647) { $to_min2 = 2147483646; } if($from_max > $to_min2) { $lasttimestamp = (int) $lasttimestamp; $timestampsec = '+0 sec'; $date1 = date_create('1970-01-01 00:00:00', $timezone_utc); $date2 = date_modify($date1, $timestampsec); $obj_rt = is_object($date2); $key3 = 1; $key4 = 1; if($obj_rt) { $transitions = timezone_transitions_get($timezone, $lasttimestamp); $count = count($transitions); if(2 > $count) { $transitions2 = timezone_transitions_get($timezone); $key2 = count($transitions2) - 1; $offset3 = $transitions2[$key2]['offset']; $lasttimestamp2 = $transitions2[$key2]['ts']; $check = $lasttimestamp2 > $lasttimestamp; if(!$check) { $lasttimestamp2 = 4160077200; $transitions3 = timezone_transitions_get($timezone, $lasttimestamp2); $offset4 = $transitions3[0]['offset']; if(7200 == $offset4) { /*foreach($transitions2 as $key => $transition) { if($lasttimestamp < $transition['ts']) { if($key2 > $key) { $key2 = $key; } } }*/ $key3 = $key2 - 1; $key4 = 0; if($key2 > 0) { $key4 = 1; } else { $key3 = 0; } //$transitiontimestamp = array($transitions2[$key3], $key4 => $transitions2[$key2]); // code here $arr = explode('T', $transitions[0]['time']); $copy = $arr[0]; $arr = explode('+', $arr[1]); $string = $copy . ' ' . $arr[0]; $date2 = null; $date1 = null; unset($date2); unset($date1); $string = strtr($string, array('+' => '')); $date1 = date_create($string, $timezone_utc); $offset1 = $transitions[0]['offset']; $timestampsec = '+'; if(0 > $offset1) { $timestampsec = ''; } $timestampsec = $timestampsec . $offset1 . ' sec'; $date2 = date_modify($date1, $timestampsec); $string = date_format($date2, 'Y-m-d H:i:s'); $date2 = null; $date1 = null; unset($date2); unset($date1); $date1 = date_create($string, $timezone); $offset2 = date_format($date1, 'Z'); $offset2 = (int) $offset2; if($offset1 != $offset2) { $key4 = $key3; //$offset3 = $transitions2[$key2]['offset']; if($offset2 == $offset3) { $key4 = $key2; } $transitions[0]['offset'] = $transitions2[$key4]['offset']; $transitions[0]['isdst'] = $transitions2[$key4]['isdst']; $transitions[0]['abbr'] = $transitions2[$key4]['abbr']; } } } $key3 = 0; $key4 = 0; } elseif($transitions[0]['ts'] == $transitions[1]['ts']) { unset($transitions[1]); if(3 > $count) { $key3 = 0; $key4 = 0; } else { $key3 = 2; } } $transitiontimestamp2 = array($transitions[0], $key4 => $transitions[$key3]); } else { // //$transitions2 = timezone_transitions_get($timezone); } } var_dump($transitiontimestamp2[0], $offset1, $offset2, $offset4); ?>

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.50.0100.01218.78
8.4.40.0130.00718.33
8.4.30.0220.00019.44
8.4.20.0480.00018.05
8.4.10.0400.01217.91
8.3.190.0110.00819.18
8.3.180.0100.00519.21
8.3.170.0100.00917.63
8.3.160.0360.01116.90
8.3.150.0330.01416.85
8.3.140.0350.01017.00
8.3.130.0330.00917.05
8.3.120.0360.00617.05
8.3.110.0330.00716.77
8.3.100.0300.01416.96
8.3.90.0140.00717.15
8.3.80.0180.00616.82
8.3.70.0160.00717.02
8.3.60.0280.00416.93
8.3.50.0330.00417.14
8.3.40.0310.01217.71
8.3.30.0390.00717.64
8.3.20.0310.00917.86
8.3.10.0400.00017.69
8.3.00.0190.00317.96
8.2.280.0070.00818.90
8.2.270.0260.01316.97
8.2.260.0330.00817.02
8.2.250.0330.00616.69
8.2.240.0320.00617.25
8.2.230.0260.01516.92
8.2.220.0410.00016.99
8.2.210.0290.00717.01
8.2.200.0220.01516.70
8.2.190.0330.00716.93
8.2.180.0250.01416.95
8.2.170.0420.00517.77
8.2.160.0350.01017.98
8.2.150.0330.00818.01
8.2.140.0250.01217.94
8.2.130.0370.00417.80
8.2.120.0290.01317.89
8.2.110.0310.00917.95
8.2.100.0400.00418.02
8.2.90.0290.00618.02
8.2.80.0310.00417.88
8.2.70.0360.00417.95
8.2.60.0220.00818.03
8.2.50.0230.01518.02
8.2.40.0270.00318.02
8.2.30.0340.00317.95
8.2.20.0390.00717.97
8.2.10.0370.00318.09
8.2.00.0330.00417.98
8.1.310.0330.00516.46
8.1.300.0360.00316.50
8.1.290.0290.00916.52
8.1.280.0280.01416.49
8.1.270.0300.00917.82
8.1.260.0310.01117.35
8.1.250.0300.00317.63
8.1.240.0320.00417.67
8.1.230.0320.01017.64
8.1.220.0370.00717.85
8.1.210.0320.00617.51
8.1.200.0250.01117.50
8.1.190.0320.00317.86
8.1.180.0320.00317.76
8.1.170.0250.01117.78
8.1.160.0270.01217.56
8.1.150.0300.00617.67
8.1.140.0250.00917.57
8.1.130.0200.01517.62
8.1.120.0290.00617.72
8.1.110.0260.01017.70
8.1.100.0210.01417.73
8.1.90.0250.00717.52
8.1.80.0280.00917.63
8.1.70.0290.01017.76
8.1.60.0210.01417.78
8.1.50.0320.00417.87
8.1.40.0330.00717.87
8.1.30.0290.01118.11
8.1.20.0170.01417.97
8.1.10.0340.00017.95
8.1.00.0280.00717.67
8.0.300.0250.01116.95
8.0.290.0320.01216.98
8.0.280.0190.00817.18
8.0.270.0300.00816.98
8.0.260.0250.01117.07
8.0.250.0280.00616.95
8.0.240.0250.01317.21
8.0.230.0400.00716.80
8.0.220.0300.00616.90
8.0.210.0350.00316.92
8.0.200.0350.00717.00
8.0.190.0170.02017.07
8.0.180.0310.00517.18
8.0.170.0290.00717.06
8.0.160.0260.01017.13
8.0.150.0360.00016.90
8.0.140.0270.00917.14
8.0.130.0290.00316.79
8.0.120.0290.00716.89
8.0.110.0270.01316.82
8.0.100.0260.01017.02
8.0.90.0290.00617.16
8.0.80.0220.00716.88
8.0.70.0230.01017.19
8.0.60.0480.00416.74
8.0.50.0270.01017.09
8.0.30.0270.00617.05
8.0.20.0250.00817.22
8.0.10.0210.01217.34
8.0.00.0290.00717.22
7.4.330.0190.01516.56
7.4.320.0260.00316.79
7.4.300.0220.00316.81
7.4.290.0270.00716.61
7.4.280.0190.01316.61
7.4.270.0340.00316.63
7.4.260.0380.00016.66
7.4.250.0320.00016.64
7.4.240.0320.00416.69
7.4.230.0260.00416.45
7.4.220.0140.01816.52
7.4.210.0320.00016.85
7.4.200.0320.00016.59
7.4.190.0270.00716.48
7.4.180.0300.00316.57
7.4.160.0240.01016.68
7.4.150.0320.00316.50
7.4.140.0200.00816.60
7.4.130.0330.00016.29
7.4.120.0230.01016.44
7.4.110.0210.01216.43
7.4.100.0220.01016.49
7.4.90.0220.01116.57
7.4.80.0240.00716.74
7.4.70.0230.00616.76
7.4.60.0230.01116.53
7.4.50.0360.00316.39
7.4.40.0290.00716.37
7.4.30.0190.01516.39
7.4.20.0240.00316.67
7.4.10.0210.00916.52
7.4.00.0300.00316.39
7.3.330.0230.00916.74
7.3.320.0190.01316.66
7.3.310.0290.00316.74
7.3.300.0320.00016.69
7.3.290.0230.00816.69
7.3.280.0320.00016.54
7.3.270.0210.01216.34
7.3.260.0280.01016.45
7.3.250.0250.00616.52
7.3.240.0290.00316.66
7.3.230.0280.00416.46
7.3.220.0330.00016.40
7.3.210.0210.01116.40
7.3.200.0270.00616.46
7.3.190.0230.00316.50
7.3.180.0310.00316.43
7.3.170.0280.00416.50
7.3.160.0250.00916.27
7.3.150.0300.00316.50
7.3.140.0260.00716.61
7.3.130.0190.01416.49
7.3.120.0200.01216.71
7.3.110.0320.00016.46
7.3.100.0160.01616.34
7.3.90.0220.01016.94
7.3.80.0210.01116.43
7.3.70.0140.01916.26
7.3.60.0290.00316.30
7.3.50.0150.00316.56
7.3.40.0310.00016.55
7.3.30.0160.01616.40
7.3.20.0290.00618.21
7.3.10.0290.00417.78
7.3.00.0250.01018.13
7.2.340.0220.01116.50
7.2.330.0250.00816.49
7.2.320.0270.00716.50
7.2.310.0260.00716.54
7.2.300.0260.00616.52
7.2.290.0130.00316.52
7.2.280.0250.00016.34
7.2.270.0230.00316.40
7.2.260.0240.00616.52
7.2.250.0240.00816.53
7.2.240.0210.01216.74
7.2.230.0270.00616.46
7.2.220.0260.00616.59
7.2.210.0150.01216.75
7.2.200.0190.01316.68
7.2.190.0250.00016.83
7.2.180.0270.00716.45
7.2.170.0230.01016.57
7.2.160.0280.00416.77
7.2.150.0260.01018.29
7.2.140.0260.00618.36
7.2.130.0330.00318.48
7.2.120.0270.00318.53
7.2.110.0240.00918.40
7.2.100.0300.00318.32
7.2.90.0140.00718.43
7.2.80.0230.00618.55
7.2.70.0290.00918.32
7.2.60.0260.00718.22
7.2.50.0240.01018.25
7.2.40.0240.00818.56
7.2.30.0320.00417.80
7.2.20.0310.00918.43
7.2.10.0290.00418.43
7.2.00.0270.00718.22
7.1.330.0280.04416.91
7.1.320.0140.06217.10
7.1.310.0070.04117.39
7.1.300.0100.04417.21
7.1.290.0150.04017.23
7.1.280.0170.07517.09
7.1.270.0130.04516.94
7.1.260.0130.04217.18
7.1.250.0160.02917.13
7.1.240.0110.05716.90
7.1.230.0070.08617.09
7.1.220.0250.05917.08
7.1.210.0140.08617.21
7.1.200.0160.04917.37
7.1.190.0100.02617.20
7.1.180.0100.02417.02
7.1.170.0120.02217.17
7.1.160.0230.04316.96
7.1.150.0160.03517.15
7.1.140.0170.06317.10
7.1.130.0200.04217.08
7.1.120.0130.02317.08
7.1.110.0140.04917.23
7.1.100.0240.04117.49
7.1.90.0190.04917.46
7.1.80.0100.03717.29
7.1.70.0160.03517.05
7.1.60.0110.03317.36
7.1.50.0060.03117.28
7.1.40.0210.03717.42
7.1.30.0100.02417.38
7.1.20.0210.02217.41
7.1.10.0080.05817.25
7.1.00.0070.02717.35
7.0.330.0140.03616.60
7.0.320.0180.04017.08
7.0.310.0290.03317.13
7.0.300.0100.02316.87
7.0.290.0220.02316.54
7.0.280.0140.04616.96
7.0.270.0220.05116.80
7.0.260.0200.06317.02
7.0.250.0070.02717.16
7.0.240.0160.07217.20
7.0.230.0260.02617.13
7.0.220.0140.04817.17
7.0.210.0140.04016.94
7.0.200.0230.04717.28
7.0.190.0130.06216.91
7.0.180.0170.05316.85
7.0.170.0180.04317.21
7.0.160.0280.04816.88
7.0.150.0250.05117.00
7.0.140.0220.05517.07
7.0.130.0270.03717.11
7.0.120.0150.02716.91
7.0.110.0140.01917.07
7.0.100.0150.06516.91
7.0.90.0220.05716.97
7.0.80.0130.02916.90
7.0.70.0240.04916.97
7.0.60.0170.03816.84
7.0.50.0240.05916.86
7.0.40.0110.02616.91
7.0.30.0180.03716.79
7.0.20.0140.02817.21
7.0.10.0110.02216.95
7.0.00.0130.04716.93
5.6.400.0160.06515.79
5.6.390.0100.02415.98
5.6.380.0120.02116.28
5.6.370.0200.06115.87
5.6.360.0100.05015.89
5.6.350.0160.03715.96
5.6.340.0230.03915.93
5.6.330.0200.04115.98
5.6.320.0140.01915.90
5.6.310.0250.07616.02
5.6.300.0170.05116.07
5.6.290.0240.06915.93
5.6.280.0100.02315.96
5.6.270.0210.05715.84
5.6.260.0070.03515.96
5.6.250.0290.05715.90
5.6.240.0160.03916.21
5.6.230.0070.03016.35
5.6.220.0260.04316.36
5.6.210.0100.02416.22
5.6.200.0120.02216.27
5.6.190.0040.02916.45
5.6.180.0210.01816.45
5.6.170.0040.03016.31
5.6.160.0080.02516.05
5.6.150.0240.04216.22
5.6.140.0210.04016.24
5.6.130.0190.03916.14
5.6.120.0160.07616.02
5.6.110.0170.04616.13
5.6.100.0100.04216.20
5.6.90.0200.04615.88
5.6.80.0190.04215.90
5.6.70.0250.04415.68
5.6.60.0100.02415.98
5.6.50.0220.03516.17
5.6.40.0140.02015.86
5.6.30.0120.02416.23
5.6.20.0130.02015.97
5.6.10.0110.03115.98
5.6.00.0170.05915.97
5.5.380.0110.05016.28
5.5.370.0200.04416.00
5.5.360.0060.04816.05
5.5.350.0310.05016.05
5.5.340.0170.07216.29
5.5.330.0150.03915.89
5.5.320.0140.04416.13
5.5.310.0100.06616.07
5.5.300.0100.05415.93
5.5.290.0070.04716.11
5.5.280.0140.02016.11
5.5.270.0070.04716.12
5.5.260.0130.04116.26
5.5.250.0160.02215.93
5.5.240.0070.02616.30
5.5.230.0180.03615.92
5.5.220.0180.04316.04
5.5.210.0210.01816.12
5.5.200.0210.04915.68
5.5.190.0110.03615.95
5.5.180.0140.02215.98
5.5.170.0100.04815.93
5.5.160.0150.04315.82
5.5.150.0240.02815.68
5.5.140.0070.02615.95
5.5.130.0180.07115.69
5.5.120.0140.02615.87
5.5.110.0250.01715.76
5.5.100.0100.02416.15
5.5.90.0160.05516.13
5.5.80.0160.04216.11
5.5.70.0240.04316.30
5.5.60.0040.03015.96
5.5.50.0100.02616.16
5.5.40.0130.04216.26
5.5.30.0070.05215.88
5.5.20.0110.02216.27
5.5.10.0120.05016.29
5.5.00.0120.02115.91
5.4.450.0160.05315.68
5.4.440.0040.02715.68
5.4.430.0160.05115.68
5.4.420.0100.04315.68
5.4.410.0100.02015.68
5.4.400.0060.02515.68
5.4.390.0040.02715.68
5.4.380.0070.02415.68
5.4.370.0070.02415.68
5.4.360.0090.02415.68
5.4.350.0090.02615.68
5.4.340.0120.02115.68
5.4.330.0100.02415.68
5.4.320.0090.02115.68
5.4.310.0170.06615.68
5.4.300.0140.02615.68
5.4.290.0100.07615.68
5.4.280.0120.02415.68
5.4.270.0130.05115.68
5.4.260.0040.04715.68
5.4.250.0140.05415.68
5.4.240.0120.02815.68
5.4.230.0130.04215.68
5.4.220.0310.03215.68
5.4.210.0040.02715.68
5.4.200.0130.04015.68
5.4.190.0190.04915.68
5.4.180.0070.04915.68
5.4.170.0130.08015.68
5.4.160.0170.07515.68
5.4.150.0140.05815.68
5.4.140.0120.01815.68
5.4.130.0100.02615.68
5.4.120.0120.02415.68
5.4.110.0100.02115.68
5.4.100.0070.04415.68
5.4.90.0100.02615.68
5.4.80.0190.03915.68
5.4.70.0090.04115.68
5.4.60.0000.05015.68
5.4.50.0000.03015.68
5.4.40.0090.02115.68
5.4.30.0100.08215.68
5.4.20.0120.03915.68
5.4.10.0000.05015.68
5.4.00.0110.02215.68
5.3.290.0070.05115.68
5.3.280.0130.04615.68
5.3.270.0160.04115.68
5.3.260.0160.07715.68
5.3.250.0070.04415.68
5.3.240.0180.03015.68
5.3.230.0120.05015.68
5.3.220.0090.02115.68
5.3.210.0100.02015.68
5.3.200.0100.06015.68
5.3.190.0140.07215.68
5.3.180.0110.02615.68
5.3.170.0100.04715.68
5.3.160.0080.02315.68
5.3.150.0100.07915.68
5.3.140.0170.05515.68
5.3.130.0140.05715.68
5.3.120.0140.05215.68
5.3.110.0170.04515.68
5.3.100.0130.03315.68
5.3.90.0180.03615.68
5.3.80.0100.02915.68
5.3.70.0040.02615.68
5.3.60.0130.05615.68
5.3.50.0070.04815.68
5.3.40.0130.04415.68
5.3.30.0090.04115.68
5.3.20.0100.05715.68
5.3.10.0170.07815.68
5.3.00.0070.04315.68
5.2.170.0080.01115.68
5.2.160.0090.00915.68
5.2.150.0180.00015.68
5.2.140.0110.00715.68
5.2.130.0120.00615.68
5.2.120.0090.00915.68
5.2.110.0080.00815.68
5.2.100.0100.01015.68
5.2.90.0150.00515.68
5.2.80.0190.00015.68
5.2.70.0150.00415.68
5.2.60.0080.00015.68
5.2.50.0130.00415.68
5.2.40.0150.00315.68
5.2.30.0170.00315.68
5.2.20.0160.00315.68
5.2.10.0090.00915.68
5.2.00.0170.00315.68
5.1.60.0120.00415.68
5.1.50.0130.00315.68
5.1.40.0160.00015.68
5.1.30.0160.00015.68
5.1.20.0100.00715.68
5.1.10.0130.00315.68
5.1.00.0120.00315.68
5.0.50.0140.00015.68
5.0.40.0090.00515.68
5.0.30.0070.00715.68
5.0.20.0070.00715.68
5.0.10.0070.00715.68
5.0.00.0070.00715.68
4.4.90.0060.00215.68
4.4.80.0040.00415.68
4.4.70.0060.00315.68
4.4.60.0080.00015.68
4.4.50.0090.00015.68
4.4.40.0050.00315.68
4.4.30.0080.00015.68
4.4.20.0090.00015.68
4.4.10.0000.00815.68
4.4.00.0060.00215.68
4.3.110.0080.00015.68
4.3.100.0090.00015.68
4.3.90.0080.00015.68
4.3.80.0080.00015.68
4.3.70.0080.00015.68
4.3.60.0080.00015.68
4.3.50.0080.00015.68
4.3.40.0060.00215.68
4.3.30.0060.00015.68
4.3.20.0070.00015.68
4.3.10.0060.00015.68
4.3.00.0060.00015.68

preferences:
51.08 ms | 403 KiB | 5 Q