3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @file requestUserInfo.php * @TIME * @brief Brief * @Author Author * @Website www.lotto-pass.cn * */ define('IN_ECS', true); //echo "<p>in request:"; //print_r($_POST); $current_path = dirname(__FILE__); $base_path = substr($current_path, 0, strlen($current_path) - strlen("/webservice")); require_once($base_path . '/includes/init.php'); require_once(ROOT_PATH . 'includes/cls_json.php'); require_once(ROOT_PATH . 'includes/lib_common.php'); // echo "<p>After include:"; require_once (ROOT_PATH . 'includes/utilities/dbutilities.php'); require_once (ROOT_PATH . 'includes/webservice/webserviceutilities.php'); require_once (ROOT_PATH . 'includes/utilities/userUtilities.php'); $device_id = getHttpRequest("device_id"); $trans_time = getHttpRequest("trans_time"); $card_number = getHttpRequest("card_number"); $sessionId = getHttpRequest("sessionId"); $sessionTime = getHttpRequest("sessionTime"); $min_required_points = getHttpRequest("mpb"); $check_sum = getHttpRequest("checksum"); $check_sum_array = array( "device_id" => $device_id, "trans_time" => $trans_time, "card_number" => $card_number, "sessionId" => $sessionId, "sessionTime" => $sessionTime, "mpb" => $min_required_points, "checksum" => $check_sum ); $check_sum_str = constructHttpParameters($check_sum_array); $resultcode = 0; $xml_string = ""; $update_data = array(); $log_date = array(); $post_data = array(); $min_factor1=5; //最低积分的倍数; $min_factor2=10; $transfer_factor1 = 0; // Not enough, no transfer $transfer_factor2 = 1; // Very low, send everything that enough for purchase $transfer_factor3 = 2; // Not enough for 10 purchases, send half of the points $transfer_factor4 = 10; // Sufficient, send points for 10 purchases. $exist_card_number = 0; $post_data['sessionId'] = $sessionId; $post_data['device_id'] = $device_id; $post_data['trans_time'] = $trans_time; $post_data['mpb'] = $min_required_points; $post_data['user_id'] = ""; $post_data['user_name'] = ""; $post_data['alias'] = "";//urlencode($alias); $post_data['display_user_points'] = 0; $post_data['message'] = ""; $post_data['transfer_points'] = 0; $post_data['user_points'] = 0; $post_data['fund_status'] = 100; //100 means not enough fund // Retrieve the jackpot related information and messages $jackpot_table_name = "jackpot_award"; $jackpot_key = "add_time"; $jackpot_sql_result = selectLastRecord($jackpot_key, $jackpot_table_name); while($sql_data = mysql_fetch_array($jackpot_sql_result, MYSQL_ASSOC)){ // echo "<p>The sql_result:"; // print_r($sql_data); $jackpot_amount = $sql_data['jackpot_amount']; $jackpot_ceiling = $sql_data['jackpot_ceiling']; $jackpot_preserved = $sql_data['jackpot_preserved']; $message_front = $sql_data['message_front']; $message_mid = $sql_data['message_mid']; $message_end = $sql_data['message_end']; $message_top = $sql_data['message_top']; //echo "The messages:".$message_front."-".$message_mid."-".$message_end."-".$message_top; $jackpot_data['jackpot_amount'] = $jackpot_amount; $jackpot_data['jackpot_ceiling'] = $jackpot_ceiling; $jackpot_data['jackpot_preserved'] = $jackpot_preserved; $jackpot_data['message_front'] = $message_front; $jackpot_data['message_mid'] = $message_mid; $jackpot_data['message_end'] = $message_end; $jackpot_data['message_top'] = $message_top; $post_data['Jackpot'] = $jackpot_data; } mysql_free_result($sql_result); // echo "<p>The post data:"; // print_r($post_data); if (checkBcc($check_sum_str, $check_sum)) { if (!existSessionId($sessionId, $sessionTime)) { // Retrieve the user information and the points from database $table_name = "users"; $conditions = "card_number = ".$card_number; $sql_result = selectConditionalRecords($conditions, $table_name); while($sql_data = mysql_fetch_array($sql_result, MYSQL_ASSOC)){ // echo "<p>The sql_result:"; // print_r($sql_data); $exist_card_number++; $user_id = $sql_data['user_id']; $user_name = $sql_data['user_name']; $alias = $sql_data['alias']; $current_user_points = abs($sql_data['user_points']); $current_frozen_points = abs($sql_data['frozen_points']); $post_data['user_id'] = $user_id; $post_data['user_name'] = $user_name; $post_data['alias'] = $alias; $post_data['display_user_points'] = abs(intval($current_user_points)); $usable_points = $current_user_points - $current_frozen_points; // echo "<p>usable_points:".$usable_points; switch ($usable_points) { case ($usable_points < $min_required_points) : // echo "<p>case: 100"; $post_data['message'] = "剩余积分不足, 请充值后再继续。"; //$usable_points = 0; $transfer_points = $usable_points * $transfer_factor1; $user_points = $current_user_points; $frozen_points = $current_frozen_points + $transfer_points; $post_data['transfer_points'] = abs(intval($transfer_points)); $post_data['user_points'] = abs(intval($user_points)); $post_data['fund_status'] = 100; //100 means not enough fund break; case ($usable_points >= $min_required_points and $usable_points <= $min_required_points*$min_factor1) : // echo "<p>case: 200"; $post_data['message'] = "剩余积分很低,请速充值。"; $transfer_points = round($usable_points/($min_required_points * $transfer_factor2),0)*$min_required_points; while ($transfer_points > $usable_points) { $transfer_points = $transfer_points - $min_required_points; } $frozen_points = $current_frozen_points + $transfer_points; $user_points = $current_user_points - $transfer_points; // echo "<p> transfer_points:".$transfer_points; $post_data['frozen_points'] = abs(intval($frozen_points)); $post_data['transfer_points'] = abs(intval($transfer_points)); $post_data['user_points'] = abs(intval($user_points)); $post_data['fund_status'] = 200; //200 means very low fund break; case ($usable_points > $min_required_points*$min_factor1 and $usable_points <= $min_required_points*$min_factor2) : // echo "<p>case: 300"; $post_data['message'] = "剩余积分低,请速充值。"; $transfer_points = round($usable_points /($min_required_points * $transfer_factor3),0)*$min_required_points; while ($transfer_points > $usable_points) { $transfer_points = $transfer_points - $min_required_points; } $frozen_points = $current_frozen_points + $transfer_points; $user_points = $current_user_points - $transfer_points; // echo "<p> transfer_points:".$transfer_points; $post_data['frozen_points'] = abs(intval($frozen_points)); $post_data['transfer_points'] = abs(intval($transfer_points)); $post_data['user_points'] = abs(intval($user_points)); $post_data['fund_status'] = 300; //300 means low fund break; case ($usable_points >= $min_required_points*$min_factor4) : // echo "<p>case: default"; $post_data['message'] = "感谢参与公益购彩。"; $transfer_points = $min_required_points*$transfer_factor4; $frozen_points = $current_frozen_points + $transfer_points; $user_points = $current_user_points - $transfer_points; // echo "<p> transfer_points:".$transfer_points; $post_data['frozen_points'] = abs(intval($frozen_points)); $post_data['transfer_points'] = abs(intval($transfer_points)); $post_data['user_points'] = abs(intval($user_points)); $post_data['fund_status'] = 1000; //1000 means sufficient fund break; default : // echo "<p>case: 0"; $post_data['message'] = "无法获取有效积分,请重试。"; $usable_points = 0; $transfer_points = 0; $user_points = 0; $post_data['transfer_points'] = 0; $post_data['user_points'] = 0; $post_data['fund_status'] = 0; //0 means not processed } } mysql_free_result($sql_result); // print_r($post_data); // Update if ($exist_card_number > 0) { $post_data['card_number'] = $card_number; $user_point_change = - $transfer_points; $frozen_points_change = $transfer_points; $change_desc = "可用积分".$usable_points.",向".$device_id."上划拨".$frozen_points."积分,资金状态".$post_data['fund_status']; log_account_change($user_id, 0, 0, 0, $user_point_change, $frozen_points_change, 0, 0, $change_desc); $resultcode = 1; $post_data['status'] = $resultcode; // Check if there is any voucher need to be printed for this user. $voucher_table_name = "active_vouchers"; $conditions = "user_id = ".$user_id." AND status = 0"; $voucher_sql_result = selectConditionalRecords($conditions, $voucher_table_name);; while($sql_data = mysql_fetch_array($voucher_sql_result, MYSQL_ASSOC)){ // echo "<p>The sql_result:"; // print_r($sql_data); $voucher_id = $sql_data['id']; $voucher_template_id = $sql_data['voucher_id']; $qr_message = $sql_data['qr_message']; $voucher_message = $sql_data['message']; $voucher_data['voucher_id'] = $voucher_id; $voucher_data['voucher_template_id'] = $voucher_template_id; $voucher_data['qr_message'] = $qr_message; $voucher_data['voucher_message'] = $voucher_message; $post_data['Coupon'] = $voucher_data; } mysql_free_result($sql_result); } else { $post_data['card_number'] = -1; } $xml_string = getArrayToXML($post_data); //echo $xml_string; $dbStatus = setSessionId($sessionId, $sessionTime, $frozen_points, $xml_string); // echo "<p> The XML_data:".$xml_string; } else { $resultcode = 2;//重发 $xml_string = getTransferred($sessionId, $sessionTime); } } else { $resultcode = 0; } header("Expires: date('Y-m-d H:i:s')"); echo $xml_string; ?>

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.0060.00918.68
8.3.50.0150.00721.98
8.3.40.0090.00618.96
8.3.30.0120.00419.29
8.3.20.0080.00020.46
8.3.10.0090.00021.80
8.3.00.0070.00319.80
8.2.180.0210.00018.54
8.2.170.0110.00722.96
8.2.160.0070.00720.39
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00319.65
8.2.110.0070.00320.88
8.2.100.0080.00318.03
8.2.90.0040.00417.96
8.2.80.0040.00417.97
8.2.70.0030.00617.75
8.2.60.0000.00918.05
8.2.50.0030.00618.07
8.2.40.0050.00318.15
8.2.30.0040.00418.24
8.2.20.0080.00017.89
8.2.10.0050.00318.30
8.2.00.0000.00817.93
8.1.280.0150.00625.92
8.1.270.0060.00320.65
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00322.48
8.1.230.0110.00321.21
8.1.220.0030.00517.77
8.1.210.0000.00819.10
8.1.200.0000.01117.60
8.1.190.0000.00817.60
8.1.180.0030.00518.10
8.1.170.0040.00420.34
8.1.160.0040.00422.20
8.1.150.0000.00718.92
8.1.140.0050.00317.64
8.1.130.0030.00317.98
8.1.120.0030.00617.70
8.1.110.0040.00417.55
8.1.100.0000.00817.61
8.1.90.0070.00017.58
8.1.80.0080.00017.64
8.1.70.0040.00417.55
8.1.60.0000.00817.82
8.1.50.0000.00817.79
8.1.40.0000.00817.76
8.1.30.0040.00417.94
8.1.20.0090.00017.80
8.1.10.0030.00617.82
8.1.00.0050.00317.62
8.0.300.0060.00320.29
8.0.290.0090.00017.13
8.0.280.0040.00418.69
8.0.270.0000.00717.50
8.0.260.0000.00817.50
8.0.250.0040.00417.25
8.0.240.0000.00717.36
8.0.230.0040.00417.23
8.0.220.0050.00217.23
8.0.210.0040.00317.25
8.0.200.0030.00317.30
8.0.190.0060.00317.21
8.0.180.0050.00317.11
8.0.170.0000.00817.22
8.0.160.0050.00317.26
8.0.150.0040.00417.13
8.0.140.0020.00517.16
8.0.130.0000.00613.61
8.0.120.0030.00515.36
8.0.110.0020.00715.33
8.0.100.0030.00615.34
8.0.90.0070.00115.32
8.0.80.0110.00415.41
8.0.70.0090.00015.38
8.0.60.0060.00315.40
8.0.50.0070.00215.29
8.0.30.0090.01016.05
8.0.20.0090.00816.14
8.0.10.0040.00415.50
8.0.00.0090.00615.80
7.4.330.0030.00315.06
7.4.320.0000.00716.54
7.4.300.0000.00616.70
7.4.290.0030.00316.71
7.4.280.0000.00816.71
7.4.270.0030.00616.79
7.4.260.0050.00316.66
7.4.250.0000.00815.01
7.4.240.0090.00015.04
7.4.230.0040.00415.05
7.4.220.0100.00515.08
7.4.210.0080.00515.53
7.4.200.0050.00315.14
7.4.190.0020.00713.50
7.4.180.0060.00313.50
7.4.160.0090.00315.04
7.4.150.0060.00715.43
7.4.140.0070.01016.36
7.4.130.0080.00815.50
7.4.120.0090.00715.60
7.4.110.0100.00514.99
7.4.100.0080.00715.04
7.4.90.0090.00415.14
7.4.80.0080.00716.36
7.4.70.0080.00515.11
7.4.60.0090.00315.00
7.4.50.0050.00414.96
7.4.40.0090.00514.99
7.4.30.0070.00714.91
7.4.20.0050.00513.23
7.4.10.0000.01013.31
7.4.00.0110.00214.11
7.3.330.0070.00013.54
7.3.320.0160.00013.47
7.3.310.0060.00215.07
7.3.300.0030.00514.95
7.3.290.0060.00215.00
7.3.280.0050.00915.87
7.3.270.0100.00315.46
7.3.260.0080.01015.04
7.3.250.0080.00815.47
7.3.240.0100.00315.08
7.3.230.0080.00815.01
7.3.220.0120.00213.47
7.3.210.0120.00614.96
7.3.200.0100.00916.32
7.3.190.0150.00515.10
7.3.180.0090.00714.91
7.3.170.0070.00915.05
7.3.160.0110.00314.89
7.3.150.0040.00413.35
7.3.140.0080.00013.35
7.3.130.0060.00313.46
7.3.120.0080.00013.32
7.3.110.0080.00013.39
7.3.100.0000.01013.21
7.3.90.0000.00813.43
7.3.80.0030.00713.21
7.3.70.0080.00013.18
7.3.60.0000.00913.36
7.3.50.0080.00013.31
7.3.40.0060.00313.47
7.3.30.0040.00413.39
7.3.20.0030.00615.05
7.3.10.0000.00914.96
7.3.00.0070.00215.10
7.2.340.0110.00413.43
7.2.330.0100.01115.17
7.2.320.0070.00815.07
7.2.310.0100.00915.05
7.2.300.0130.00615.19
7.2.290.0080.01015.12
7.2.280.0070.01013.38
7.2.270.0080.00913.41
7.2.260.0100.00313.30
7.2.250.0110.00413.41
7.2.240.0120.00313.48
7.2.230.0060.00813.56
7.2.220.0110.00413.48
7.2.210.0070.00713.42
7.2.200.0130.00313.55
7.2.190.0070.00713.57
7.2.180.0100.00613.52
7.2.170.0090.00413.51
7.2.160.0150.00013.61
7.2.150.0140.00015.22
7.2.140.0120.00415.12
7.2.130.0110.00415.33
7.2.120.0060.00915.26
7.2.110.0150.00015.37
7.2.100.0100.00515.32
7.2.90.0150.00015.29
7.2.80.0090.00915.14
7.2.70.0120.00315.38
7.2.60.0080.00615.97
7.2.50.0090.00615.14
7.2.40.0080.00615.14
7.2.30.0120.00415.27
7.2.20.0120.00315.30
7.2.10.0040.00715.39
7.2.00.0080.00717.45
7.1.330.0100.00314.22
7.1.320.0120.00314.05
7.1.310.0130.00014.16
7.1.300.0120.00314.06
7.1.290.0050.00914.25
7.1.280.0130.00014.06
7.1.270.0120.00214.05
7.1.260.0070.00714.16
7.1.250.0110.00313.98
7.1.240.0080.00514.19
7.1.230.0040.00914.20
7.1.220.0090.00314.17
7.1.210.0100.00214.17
7.1.200.0080.00615.11
7.1.190.0040.00814.05
7.1.180.0090.00514.23
7.1.170.0100.00214.00
7.1.160.0070.00514.10
7.1.150.0080.00414.00
7.1.140.0120.00014.00
7.1.130.0040.00814.10
7.1.120.0100.00213.98
7.1.110.0090.00313.99
7.1.100.0060.00716.18
7.1.90.0070.00514.13
7.1.80.0070.00514.26
7.1.70.0090.00215.61
7.1.60.0090.01016.84
7.1.50.0110.00915.59
7.1.40.0130.00014.04
7.1.30.0100.00314.15
7.1.20.0090.00214.17
7.1.10.0060.00614.09
7.1.00.0110.03318.19
7.0.330.0000.01114.03
7.0.320.0060.00614.13
7.0.310.0130.00014.03
7.0.300.0030.00914.03
7.0.290.0110.00314.07
7.0.280.0090.00314.20
7.0.270.0090.00314.09
7.0.260.0080.00814.24
7.0.250.0060.00614.11
7.0.240.0080.00414.22
7.0.230.0090.00314.24
7.0.220.0090.00314.03
7.0.210.0120.00014.28
7.0.200.0090.00315.29
7.0.190.0120.00014.16
7.0.180.0070.00514.12
7.0.170.0000.01314.25
7.0.160.0090.00314.09
7.0.150.0120.00013.89
7.0.140.0100.03317.96
7.0.130.0120.00014.09
7.0.120.0070.00414.32
7.0.110.0040.00814.09
7.0.100.0130.02117.08
7.0.90.0090.03516.98
7.0.80.0100.03117.00
7.0.70.0090.02316.94
7.0.60.0070.03917.08
7.0.50.0080.04117.17
7.0.40.0080.04317.14
7.0.30.0040.03417.10
7.0.20.0070.04717.08
7.0.10.0060.02617.08
7.0.00.0070.03217.02
5.6.400.0060.00612.45
5.6.390.0070.00412.59
5.6.380.0120.00012.76
5.6.370.0060.00612.55
5.6.360.0090.00212.55
5.6.350.0030.00512.55
5.6.340.0090.00212.41
5.6.330.0070.00512.54
5.6.320.0130.00012.57
5.6.310.0000.01312.73
5.6.300.0140.00012.63
5.6.290.0120.00012.61
5.6.280.0070.03517.01
5.6.270.0070.00412.59
5.6.260.0090.00312.76
5.6.250.0090.03516.56
5.6.240.0050.03916.61
5.6.230.0050.02916.66
5.6.220.0080.02016.60
5.6.210.0060.03816.75
5.6.200.0110.04017.00
5.6.190.0080.02516.84
5.6.180.0100.03316.94
5.6.170.0150.04016.92
5.6.160.0070.03916.90
5.6.150.0090.03516.99
5.6.140.0070.02716.77
5.6.130.0140.03016.87
5.6.120.0050.03816.98
5.6.110.0090.02016.77
5.6.100.0070.03516.90
5.6.90.0140.03316.84
5.6.80.0060.03516.56
5.6.70.0020.04916.64
5.6.60.0080.03016.56
5.6.50.0050.02716.67
5.6.40.0050.02316.51
5.6.30.0040.02516.55
5.6.20.0020.04216.58
5.6.10.0050.02016.50
5.6.00.0050.02716.54
5.5.380.0080.03916.55
5.5.370.0070.03416.61
5.5.360.0060.04316.49
5.5.350.0060.04216.58
5.5.340.0070.02016.65
5.5.330.0080.02516.75
5.5.320.0080.02116.80
5.5.310.0050.04116.65
5.5.300.0130.02016.73
5.5.290.0060.02516.72
5.5.280.0100.04516.67
5.5.270.0070.02216.73
5.5.260.0030.02816.59
5.5.250.0080.03516.74
5.5.240.0060.03816.38
5.5.230.0050.03516.40
5.5.220.0060.03616.37
5.5.210.0100.03016.42
5.5.200.0090.01916.25
5.5.190.0050.02216.44
5.5.180.0040.03416.37
5.5.170.0110.00012.39
5.5.160.0110.03716.48
5.5.150.0090.03816.36
5.5.140.0050.03116.40
5.5.130.0120.02816.38
5.5.120.0090.01816.31
5.5.110.0070.04416.33
5.5.100.0070.02016.29
5.5.90.0040.02316.28
5.5.80.0030.04016.23
5.5.70.0090.02516.31
5.5.60.0110.01716.43
5.5.50.0040.02516.31
5.5.40.0080.02116.25
5.5.30.0110.03816.32
5.5.20.0140.03016.30
5.5.10.0120.03516.20
5.5.00.0090.03616.26
5.4.450.0130.02015.78
5.4.440.0090.03715.84
5.4.430.0070.02516.00
5.4.420.0050.02415.90
5.4.410.0090.01715.88
5.4.400.0050.03115.71
5.4.390.0090.04115.75
5.4.380.0040.02415.88
5.4.370.0080.02115.79
5.4.360.0060.03915.77
5.4.350.0090.03015.74
5.4.340.0060.04315.78
5.4.330.0110.00012.41
5.4.320.0050.02815.97
5.4.310.0040.02715.79
5.4.300.0060.02115.94
5.4.290.0070.03015.79
5.4.280.0040.02815.93
5.4.270.0080.04115.77
5.4.260.0070.02815.71
5.4.250.0120.03015.74
5.4.240.0090.03315.60
5.4.230.0100.04215.70
5.4.220.0060.02115.73
5.4.210.0050.03515.84
5.4.200.0070.03215.73
5.4.190.0100.03715.77
5.4.180.0060.02315.72
5.4.170.0060.03715.63
5.4.160.0090.01815.73
5.4.150.0090.04215.62
5.4.140.0040.03314.40
5.4.130.0060.02014.46
5.4.120.0050.02214.55
5.4.110.0070.01814.48
5.4.100.0090.03314.54
5.4.90.0070.01714.52
5.4.80.0050.02014.45
5.4.70.0070.01814.38
5.4.60.0050.02214.55
5.4.50.0080.01614.42
5.4.40.0070.03514.30
5.4.30.0070.02514.49
5.4.20.0050.02514.45
5.4.10.0030.03714.43
5.4.00.0050.01814.12

preferences:
63.7 ms | 401 KiB | 5 Q