3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Implements hook_rules_action_info(). */ function tour_scheduling_rules_action_info() { $actions = array( 'tour_scheduling_action_disable_timeslot' => array( 'label' => t('Disable a Time Slot'), 'group' => t('Tour Scheduling'), 'parameter' => array( 'tourdate' => array( 'type' => 'date', 'label' => t('Tour Date'), 'save' => FALSE, ), ), ), 'tour_scheduling_action_enable_timeslot' => array( 'label' => t('Enable a Time Slot'), 'group' => t('Tour Scheduling'), 'parameter' => array( 'tourdate' => array( 'type' => 'date', 'label' => t('Tour Date'), 'save' => FALSE, ), ), ), ); return $actions; } /** * Action: Disable a Time Slot. */ function tour_scheduling_action_disable_timeslot($tourdate) { if (date('I', $tourdate) == 1) { $tourdate = date('Y-m-d H:i:s', $tourdate + 14400); } elseif (date('I', $tourdate) == 0) { $tourdate = date('Y-m-d H:i:s', $tourdate + 18000); } $slot = db_select('field_data_field_time_slot', 'ts') ->fields('ts', array('entity_id')) ->condition('field_time_slot_value', $tourdate, '=') ->execute(); $timeslot = $slot->fetchField(0); $node = node_load($timeslot); $node->status = 0; $node->changed = date(REQUEST_TIME); node_save($node); } /** * Action: Enable a Time Slot. */ function tour_scheduling_action_enable_timeslot($tourdate) { if (date('I', $tourdate) == 1) { $tourdate = date('Y-m-d H:i:s', $tourdate + 14400); } elseif (date('I', $tourdate) == 0) { $tourdate = date('Y-m-d H:i:s', $tourdate + 18000); } $slot = db_select('field_data_field_time_slot', 'ts') ->fields('ts', array('entity_id')) ->condition('field_time_slot_value', $tourdate, '=') ->execute(); $timeslot = $slot->fetchField(0); $node = node_load($timeslot); $node->status = 1; $node->changed = date(REQUEST_TIME); node_save($node); }

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.3.60.0150.00318.43
8.3.50.0080.00820.96
8.3.40.0110.00718.55
8.3.30.0100.00720.17
8.3.20.0000.00820.28
8.3.10.0040.00420.97
8.3.00.0000.00723.46
8.2.180.0120.00816.50
8.2.170.0110.00422.96
8.2.160.0140.00020.34
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0040.00420.95
8.2.110.0030.00622.20
8.2.100.0040.00817.78
8.2.90.0040.00418.96
8.2.80.0050.00317.97
8.2.70.0000.00817.50
8.2.60.0030.00617.80
8.2.50.0030.00618.07
8.2.40.0040.00418.09
8.2.30.0000.00719.46
8.2.20.0050.00217.64
8.2.10.0040.00417.64
8.2.00.0040.00417.59
8.1.280.0140.00325.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0040.00422.05
8.1.230.0000.01217.45
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0050.00517.10
8.1.190.0040.00417.40
8.1.180.0030.00618.10
8.1.170.0000.00918.51
8.1.160.0040.00418.71
8.1.150.0000.00718.45
8.1.140.0040.00417.37
8.1.130.0030.00317.90
8.1.120.0000.00717.39
8.1.110.0040.00417.36
8.1.100.0040.00417.28
8.1.90.0040.00417.40
8.1.80.0000.00717.31
8.1.70.0040.00417.35
8.1.60.0030.00617.50
8.1.50.0070.00017.34
8.1.40.0040.00417.32
8.1.30.0000.00817.56
8.1.20.0000.00817.45
8.1.10.0000.00717.48
8.1.00.0000.00717.37
8.0.300.0040.00418.77
8.0.290.0000.00816.63
8.0.280.0030.00318.34
8.0.270.0080.00017.20
8.0.260.0030.00316.64
8.0.250.0060.00316.69
8.0.240.0070.00016.84
8.0.230.0040.00416.89
8.0.220.0000.00716.77
8.0.210.0030.00316.74
8.0.200.0050.00316.81
8.0.190.0040.00416.83
8.0.180.0030.00516.84
8.0.170.0080.00016.70
8.0.160.0040.00316.73
8.0.150.0000.00716.76
8.0.140.0030.00616.79
8.0.130.0030.00313.26
8.0.120.0050.00316.84
8.0.110.0040.00416.78
8.0.100.0070.00016.82
8.0.90.0000.00716.64
8.0.80.0070.01416.74
8.0.70.0000.00716.77
8.0.60.0000.00716.61
8.0.50.0040.00416.68
8.0.30.0070.01117.01
8.0.20.0150.00817.40
8.0.10.0040.00416.82
8.0.00.0070.01216.62
7.4.330.0000.00615.09
7.4.320.0030.00316.39
7.4.300.0030.00316.31
7.4.290.0030.00316.46
7.4.280.0000.00716.54
7.4.270.0000.00716.39
7.4.260.0050.00013.19
7.4.250.0000.00716.45
7.4.240.0000.00816.41
7.4.230.0030.00316.24
7.4.220.0250.00016.53
7.4.210.0060.00916.48
7.4.200.0020.00516.49
7.4.190.0030.00316.34
7.4.160.0100.01016.38
7.4.150.0120.00617.40
7.4.140.0060.01417.86
7.4.130.0090.01416.49
7.4.120.0140.00316.46
7.4.110.0070.01016.35
7.4.100.0100.01316.30
7.4.90.0100.00616.27
7.4.80.0100.00619.39
7.4.70.0110.00616.37
7.4.60.0030.01316.43
7.4.50.0040.00416.47
7.4.40.0110.00422.77
7.4.30.0040.01416.25
7.4.10.0080.01114.85
7.4.00.0070.01014.78
7.3.330.0030.00313.03
7.3.320.0000.00613.14
7.3.310.0040.00416.19
7.3.300.0040.00416.25
7.3.290.0090.00616.25
7.3.280.0070.01116.21
7.3.270.0060.01217.40
7.3.260.0080.01018.24
7.3.250.0080.01216.48
7.3.240.0130.00316.17
7.3.230.0070.01016.46
7.3.210.0120.00616.15
7.3.200.0060.01519.39
7.3.190.0030.01316.31
7.3.180.0080.00816.19
7.3.170.0070.01016.46
7.3.160.0170.00016.43
7.3.130.0070.00914.67
7.3.120.0070.00914.58
7.3.110.0090.00914.69
7.3.100.0090.00614.68
7.3.90.0070.00714.59
7.3.80.0080.00114.61
7.3.70.0040.01014.68
7.3.60.0050.00914.49
7.3.50.0080.00614.66
7.3.40.0060.00414.68
7.3.30.0070.00714.73
7.3.20.0100.00716.36
7.3.10.0060.00816.43
7.3.00.0090.00316.38
7.2.330.0060.01116.57
7.2.320.0060.01216.19
7.2.310.0110.01116.39
7.2.300.0070.01016.52
7.2.290.0090.01216.56
7.2.260.0100.00914.69
7.2.250.0040.01414.74
7.2.240.0040.01014.90
7.2.230.0040.00914.75
7.2.220.0080.00614.94
7.2.210.0020.01114.89
7.2.200.0040.00914.80
7.2.190.0040.01214.76
7.2.180.0040.01014.74
7.2.170.0040.00714.80
7.2.160.0050.00914.85
7.2.150.0040.00916.68
7.2.140.0040.01016.64
7.2.130.0040.01016.56
7.2.120.0080.00416.76
7.2.110.0030.01116.68
7.2.100.0060.00616.52
7.2.90.0060.00816.66
7.2.80.0080.00516.76
7.2.70.0050.00816.73
7.2.60.0060.00716.48
7.2.50.0040.01016.65
7.2.40.0060.00616.80
7.2.30.0090.00716.80
7.2.20.0020.01016.65
7.2.10.0120.00416.71
7.2.00.0030.01117.35
7.1.330.0040.01015.47
7.1.320.0060.00815.63
7.1.310.0090.00415.79
7.1.300.0030.00715.55
7.1.290.0060.00515.52
7.1.280.0050.00815.44
7.1.270.0060.00715.66
7.1.260.0050.00715.45
7.1.250.0050.00515.61
7.1.240.0060.00815.58
7.1.230.0070.00715.56
7.1.220.0040.01015.59
7.1.210.0100.00415.54
7.1.200.0030.00915.60
7.1.190.0050.00815.52
7.1.180.0060.00815.45
7.1.170.0050.00715.61
7.1.160.0060.00415.56
7.1.150.0010.00915.52
7.1.140.0050.00915.57
7.1.130.0020.01215.52
7.1.120.0080.00515.55
7.1.110.0050.00915.65
7.1.100.0090.00416.18
7.1.90.0060.00615.50
7.1.80.0060.00715.64
7.1.70.0060.00816.00
7.1.60.0070.00916.46
7.1.50.0050.00815.96
7.1.40.0040.00815.69
7.1.30.0080.00715.65
7.1.20.0040.00915.50
7.1.10.0060.00915.49
7.1.00.0050.01717.21
7.0.330.0060.00615.22
7.0.320.0080.00615.16
7.0.310.0040.00715.23
7.0.300.0040.00715.19
7.0.290.0070.00615.19
7.0.280.0030.01015.03
7.0.270.0050.00615.13
7.0.260.0080.00415.06
7.0.250.0040.00715.24
7.0.240.0070.00715.19
7.0.230.0060.00515.17
7.0.220.0060.00515.36
7.0.210.0050.01015.25
7.0.200.0050.00615.61
7.0.190.0040.00715.20
7.0.180.0050.00815.17
7.0.170.0050.00915.17
7.0.160.0070.00515.31
7.0.150.0090.00415.20
7.0.140.0040.02316.97
7.0.130.0060.00815.34
7.0.120.0050.01115.24
7.0.110.0070.00715.34
7.0.100.0070.00515.13
7.0.90.0050.00815.27
7.0.80.0100.02216.42
7.0.70.0040.01816.34
7.0.60.0170.02416.32
7.0.50.0120.01416.53
7.0.40.0050.02414.99
7.0.30.0050.01914.90
7.0.20.0080.02115.04
7.0.10.0110.01714.98
7.0.00.0030.02515.06
5.6.400.0070.00814.13
5.6.390.0070.00613.92
5.6.380.0020.01014.11
5.6.370.0060.00514.09
5.6.360.0040.00714.22
5.6.350.0050.00814.21
5.6.340.0060.00814.04
5.6.330.0070.00414.00
5.6.320.0040.00714.08
5.6.310.0070.00713.92
5.6.300.0040.00914.16
5.6.290.0070.00614.17
5.6.280.0030.02815.84
5.6.270.0060.01114.22
5.6.260.0090.00313.93
5.6.250.0050.00614.12
5.6.240.0010.00914.14
5.6.230.0080.02515.72
5.6.220.0090.02315.66
5.6.210.0050.02315.68
5.6.200.0090.02215.87
5.6.190.0070.02515.76
5.6.180.0100.02215.77
5.6.170.0070.02415.95
5.6.160.0100.02215.84
5.6.150.0040.02015.86
5.6.140.0060.02515.76
5.6.130.0070.02315.93
5.6.120.0090.02515.77
5.6.110.0060.02815.84
5.6.100.0060.02315.70
5.6.90.0060.02115.98
5.6.80.0050.01915.50
5.6.70.0050.02515.57
5.6.60.0070.01715.59
5.6.50.0040.02415.62
5.6.40.0060.01715.54
5.6.30.0070.02315.69
5.6.20.0040.01815.64
5.6.10.0090.01915.60
5.6.00.0080.02015.69
5.5.380.0040.01013.91
5.5.370.0070.02215.61
5.5.360.0050.01815.77
5.5.350.0070.02515.73
5.5.340.0040.01915.85
5.5.330.0050.02715.78
5.5.320.0070.01915.77
5.5.310.0100.02115.70
5.5.300.0050.02615.69
5.5.290.0030.01915.89
5.5.280.0070.02615.68
5.5.270.0050.02115.90
5.5.260.0060.02115.77
5.5.250.0070.02115.47
5.5.240.0060.01415.47
5.5.230.0020.03015.38
5.5.220.0060.01815.43
5.5.210.0060.02315.53
5.5.200.0070.02315.38
5.5.190.0070.02015.51
5.5.180.0030.02215.51
5.5.170.0040.00913.96
5.5.160.0060.02615.57
5.5.150.0070.02415.42
5.5.140.0080.01515.52
5.5.130.0060.01915.56
5.5.120.0060.02315.42
5.5.110.0110.02215.66
5.5.100.0060.01615.64
5.5.90.0060.02215.55
5.5.80.0080.02415.42
5.5.70.0070.02315.40
5.5.60.0080.01415.39
5.5.50.0070.02115.47
5.5.40.0060.02515.30
5.5.30.0080.02115.32
5.5.20.0080.02415.44
5.5.10.0080.01815.63
5.5.00.0040.02515.45
5.4.450.0030.02613.77
5.4.440.0050.02413.82
5.4.430.0060.02113.76
5.4.420.0040.01913.64
5.4.410.0080.02013.67
5.4.400.0050.02113.55
5.4.390.0020.01913.65
5.4.380.0040.02213.62
5.4.370.0060.02313.62
5.4.360.0080.02013.70
5.4.350.0020.02713.70
5.4.340.0070.02113.68
5.4.330.0020.00711.86
5.4.320.0070.02113.67
5.4.310.0050.02113.71
5.4.300.0050.02213.60
5.4.290.0050.01813.64
5.4.280.0050.02313.64
5.4.270.0040.01813.65
5.4.260.0030.02613.73
5.4.250.0050.02613.65
5.4.240.0030.01813.67
5.4.230.0030.01713.65
5.4.220.0060.01613.65
5.4.210.0080.02013.63
5.4.200.0020.02213.60
5.4.190.0100.01913.68
5.4.180.0070.01813.68
5.4.170.0050.02413.65
5.4.160.0050.02413.67
5.4.150.0030.02313.76
5.4.140.0030.01713.02
5.4.130.0030.02313.01
5.4.120.0040.01713.03
5.4.110.0050.02312.97
5.4.100.0050.02213.06
5.4.90.0050.01512.99
5.4.80.0060.01412.95
5.4.70.0060.02113.02
5.4.60.0050.01812.86
5.4.50.0050.01313.02
5.4.40.0070.02213.04
5.4.30.0050.01612.96
5.4.20.0070.01512.89
5.4.10.0040.02312.92
5.4.00.0050.02012.90
5.3.290.0040.02512.51
5.3.280.0070.01912.43
5.3.270.0070.02212.46
5.3.260.0070.02112.48
5.3.250.0080.01912.48
5.3.240.0060.02312.43
5.3.230.0070.02012.46
5.3.220.0060.01312.44
5.3.210.0030.02212.44
5.3.200.0040.02312.44
5.3.190.0070.02012.46
5.3.180.0090.01212.50
5.3.170.0080.02212.44
5.3.160.0020.02112.51
5.3.150.0030.01312.45
5.3.140.0070.01512.49
5.3.130.0050.02412.46
5.3.120.0060.02512.45
5.3.110.0050.01512.46
5.3.100.0030.02612.29
5.3.90.0050.02112.33
5.3.80.0080.02012.27
5.3.70.0040.01712.30
5.3.60.0040.02512.27
5.3.50.0040.02412.31
5.3.40.0060.02212.28
5.3.30.0050.02212.27
5.3.20.0060.01312.21
5.3.10.0040.02012.23
5.3.00.0070.01412.20
5.2.170.0070.05711.02
5.2.160.0070.06311.27
5.2.150.0070.04311.21
5.2.140.0030.03711.18
5.2.130.0000.06711.20
5.2.120.0070.06011.25
5.2.110.0130.03711.06
5.2.100.0030.05711.23
5.2.90.0100.05711.11
5.2.80.0030.04010.98
5.2.70.0170.05311.12
5.2.60.0000.04310.96
5.2.50.0100.04711.06
5.2.40.0070.03010.87
5.2.30.0030.05310.88
5.2.20.0070.05710.93
5.2.10.0170.04710.78
5.2.00.0030.06310.79
5.1.60.0030.04010.08
5.1.50.0000.0339.86
5.1.40.0230.0139.89
5.1.30.0030.05710.47
5.1.20.0000.05010.43
5.1.10.0100.02310.17
5.1.00.0030.05710.08
5.0.50.0070.0178.64
5.0.40.0000.0478.43
5.0.30.0070.0608.09
5.0.20.0030.0338.29
5.0.10.0030.0308.19
5.0.00.0100.0578.18
4.4.90.0000.0337.82
4.4.80.0130.0207.82
4.4.70.0030.0177.82
4.4.60.0030.0337.82
4.4.50.0100.0337.82
4.4.40.0070.0437.82
4.4.30.0070.0307.82
4.4.20.0030.0337.82
4.4.10.0000.0337.82
4.4.00.0000.0477.82
4.3.110.0000.0307.82
4.3.100.0030.0207.82
4.3.90.0000.0277.82
4.3.80.0000.0407.82
4.3.70.0000.0377.82
4.3.60.0000.0337.82
4.3.50.0070.0307.82
4.3.40.0000.0577.82
4.3.30.0000.0377.82
4.3.20.0030.0337.82
4.3.10.0000.0377.82
4.3.00.0100.0207.82

preferences:
42.36 ms | 401 KiB | 5 Q