Anonymous View

3v4l.org

run code in 500+ PHP versions simultaneously
<?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); // 処理 return $data; } } $userId = '123456'; $data = TestStatus::process($userId);

preferences:
49.25 ms | 751 KiB | 5 Q