3v4l.org

run code in 500+ PHP versions simultaneously
<?php public function accessWithdraw( $withdraw_id, $operator_id, $sinaParams=array() ){ $RechargeApi = new RechargeApi(); $SinaApi = new SinaApi(); $model = new Model(); $model->startTrans(); try{ $sql = "SELECT id,accountId,money FROM yx_withdraw WHERE id = $withdraw_id AND (status=1 or status=9)"; $withdraw = $this->query( $sql )->fetch(); if(!$withdraw) throw new \PDOException("回调提现订单不在提现列表: [{$sql}]。".$this->getSqlErrorString()); $money = $withdraw['money']; // 提现金额 $accountId = $withdraw['accountId']; // 提现用户 // 更新提现表 $sql = "UPDATE yx_withdraw SET status='{$sinaParams['status']}', action_time='{$sinaParams['payTime']}' WHERE id={$withdraw_id}"; $r1 = $this->exec($sql); if(!$r1) throw new \PDOException("批量提现成功后,更新永利宝提现表失败: [{$sql}]。".$this->getSqlErrorString()); trace_money($accountId, \LogRules::BATCH_WITHDRAW_UPDATE_YLB_FINISH, "操作结束:[{$accountId}]提现[$money]元回调更新yx_withdraw表状态成功"); // 更新新浪提现表 $sql = "UPDATE bw_sina_user_withdraw SET status=2, pay_time={$sinaParams['pay_time']}, response_code='{$sinaParams['withdraw_status']}',response_message='{$sinaParams['error_message']}' WHERE withdraw_id={$withdraw_id}"; $r2 = $this->exec( $sql ); if(!$r2) throw new \PDOException("批量提现成功后,更新新浪提现表: [{$sql}]。".$this->getSqlErrorString()); trace_money($accountId, \LogRules::BATCH_WITHDRAW_UPDATE_SINA_FINISH, "操作结束:[{$accountId}]提现[$money]元回调更新bw_sina_user_withdraw表状态成功"); // 插入公司资金流表 $sql = "INSERT INTO bw_sina_company_record(`money`, `io`, `type`, `userId`, `created`, `response_code`, `response_message`) VALUES({$money}, '-1', 1, $accountId, $sinaParams['payTime'], '{$sinaParams['response_code']}', '{$sinaParams['response_message']}') "; $r3 = $this->exec($sql); if(!$r3) throw new \PDOException("提现成功后,插入公司资金流表失败: [{$sql}]。".$this->getSqlErrorString()); trace_money($accountId, \LogRules::BATCH_WITHDRAW_UPDATE_COMPANY_FINISH, "操作结束:[{$accountId}]提现[$money]元回调更新bw_sina_company_record表状态成功"); $model->commit(); }catch(\Exception $e){ $model->rollback(); trace_error($user_id, \LogRules::BATCH_WITHDRAW_ACTION_ERROR, array('withdraw_id'=>$withdraw_id,'error'=>$e->getMessage())); } }

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)
5.6.100.0070.08321.02
5.6.90.0100.06721.10
5.6.80.0070.03320.50
5.6.70.3300.03020.27
5.5.260.0030.04720.83
5.5.250.0030.08320.55
5.5.240.0330.06020.06
5.4.420.0300.06319.27
5.4.410.0200.04019.18
5.4.400.0330.07019.00
5.4.390.0300.04019.07
5.4.380.0330.06018.86
5.4.370.0270.05019.05
5.4.360.0270.07719.08
5.4.350.0300.05019.14
5.4.340.0300.05719.08
5.4.320.0330.06719.22
5.4.310.0370.07019.22
5.4.300.0230.03719.00
5.4.290.0370.04718.85
5.4.280.0330.02718.94
5.4.270.0200.03719.24
5.4.260.0530.03719.19
5.4.250.0330.03719.00
5.4.240.0270.07718.94
5.4.230.0300.06719.13
5.4.220.0330.06719.13
5.4.210.0300.06718.99
5.4.200.0270.03718.87
5.4.190.0200.05019.19
5.4.180.0230.04719.08
5.4.170.0200.04018.84
5.4.160.0300.07719.12
5.4.150.0270.06319.06
5.4.140.0230.04316.33
5.4.130.0300.06716.28
5.4.120.0270.06316.34
5.4.110.0270.03716.56
5.4.100.0270.04316.37
5.4.90.0230.03716.42
5.4.80.0300.06716.52
5.4.70.0300.04716.44
5.4.60.0230.03716.38
5.4.50.0300.06016.38
5.4.40.0230.06716.54
5.4.30.0270.06716.42
5.4.20.0230.04716.50
5.4.10.0170.04716.51
5.4.00.0270.06015.79
5.3.290.0330.07014.51
5.3.280.0230.04314.64
5.3.270.0270.03314.49
5.3.260.0300.06314.45
5.3.250.0230.07714.64
5.3.240.0400.06314.65
5.3.230.0370.04314.45
5.3.220.0270.07014.52
5.3.210.0270.05014.54
5.3.200.0330.05314.41
5.3.190.0270.04014.44
5.3.180.0330.06314.59
5.3.170.0330.06314.41
5.3.160.0500.05014.40
5.3.150.0230.07314.43
5.3.140.0300.07314.41
5.3.130.0300.07014.58
5.3.120.0400.06014.64
5.3.110.0230.05314.39
5.3.100.0370.06014.15
5.3.90.0270.05313.98
5.3.80.0300.04314.01
5.3.70.0230.07313.84
5.3.60.0270.05713.83
5.3.50.0300.06313.74
5.3.40.0300.06313.99
5.3.30.0270.04713.81
5.3.20.0270.04713.54
5.3.10.0200.04013.60
5.3.00.0230.07313.72
5.2.170.0200.04311.28
5.2.160.0230.05711.28
5.2.150.0270.02711.28
5.2.140.0170.05011.28
5.2.130.0230.06011.28
5.2.120.0200.04011.28
5.2.110.0200.06011.28
5.2.100.0200.03011.28
5.2.90.0200.05311.28
5.2.80.0130.03311.28
5.2.70.0230.02711.28
5.2.60.0330.04711.28
5.2.50.0230.04011.28
5.2.40.0230.03011.28
5.2.30.0400.04011.28
5.2.20.0170.04311.28
5.2.10.0200.04711.28
5.2.00.0200.05711.28
5.1.60.0230.04311.28
5.1.50.0200.03311.28
5.1.40.0130.05011.28
5.1.30.0170.04011.28
5.1.20.0200.02311.28
5.1.10.0130.04011.28
5.1.00.0130.05011.28
5.0.50.0100.03311.28
5.0.40.0100.02011.28
5.0.30.0100.06311.28
5.0.20.0200.02311.28
5.0.10.0070.04711.28
5.0.00.0030.03311.28
4.4.90.0070.01711.28
4.4.80.0030.02311.28
4.4.70.0070.03711.28
4.4.60.0100.03011.28
4.4.50.0100.02711.28
4.4.40.0130.04011.28
4.4.30.0030.02711.28
4.4.20.0070.02711.28
4.4.10.0170.03011.28
4.4.00.0100.05311.28
4.3.110.0100.01711.28
4.3.100.0070.02311.28
4.3.90.0100.01711.28
4.3.80.0070.02311.28
4.3.70.0100.01311.28
4.3.60.0070.01311.28
4.3.50.0070.01311.28
4.3.40.0100.02311.28
4.3.30.0030.01711.28
4.3.20.0030.01311.28
4.3.10.0030.01311.28
4.3.00.0000.01711.28

preferences:
57.86 ms | 1032 KiB | 4 Q