<?php //$_POST['event_id'] = '1'; function executeDone() { $eventId = (isset($_POST['event_id'])) ? (int)$_POST['event_id'] : ''; var_dump($eventId); } $res = executeDone(); class TestEvent { public static function getCurrentEvent() { // 開催中のイベントIDを取得 $eventId = 10; return $eventId; } } class TestStatus { private $eventId; private $userId; public function __construct($eventId, $userId) { $this->eventId = $eventId; $this->userId = $userId; } public static function process($userId) { $eventId = TestEvent::getCurrentEvent(); $obj = new TestStatus($eventId, $userId); // 処理 $data = ['num' => 1]; return $data; } } $userId = '123456'; $data = TestStatus::process($userId);
You have javascript disabled. You will not be able to edit any code.