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())); } }
Output for 5.4.0 - 5.4.42, 5.5.24 - 5.5.26, 5.6.7 - 5.6.10
Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /in/BsQYv on line 3
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_PUBLIC in /in/BsQYv on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_PUBLIC in /in/BsQYv on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_FUNCTION in /in/BsQYv on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_FUNCTION in /in/BsQYv on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/BsQYv on line 3
Process exited with code 255.

preferences:
45.48 ms | 1032 KiB | 3 Q