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); // 処理 $data = ['num' => 1]; return $data; } } $userId = '123456'; $data = TestStatus::process($userId);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HTthL
function name:  (null)
number of ops:  9
compiled vars:  !0 = $res, !1 = $userId, !2 = $data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                                   'executedone'
          1        DO_FCALL                                          0  $3      
          2        ASSIGN                                                       !0, $3
   35     3        ASSIGN                                                       !1, '123456'
   36     4        INIT_STATIC_METHOD_CALL                                      'TestStatus', 'process'
          5        SEND_VAR                                                     !1
          6        DO_FCALL                                          0  $6      
          7        ASSIGN                                                       !2, $6
          8      > RETURN                                                       1

Function executedone:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HTthL
function name:  executeDone
number of ops:  14
compiled vars:  !0 = $eventId
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   FETCH_IS                                             ~1      '_POST'
          1        ISSET_ISEMPTY_DIM_OBJ                             0          ~1, 'event_id'
          2      > JMPZ                                                         ~2, ->8
          3    >   FETCH_R                          global              ~3      '_POST'
          4        FETCH_DIM_R                                          ~4      ~3, 'event_id'
          5        CAST                                              4  ~5      ~4
          6        QM_ASSIGN                                            ~6      ~5
          7      > JMP                                                          ->9
          8    >   QM_ASSIGN                                            ~6      ''
          9    >   ASSIGN                                                       !0, ~6
    7    10        INIT_FCALL                                                   'var_dump'
         11        SEND_VAR                                                     !0
         12        DO_ICALL                                                     
    8    13      > RETURN                                                       null

End of function executedone

Class TestEvent:
Function getcurrentevent:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HTthL
function name:  getCurrentEvent
number of ops:  3
compiled vars:  !0 = $eventId
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                       !0, 10
   15     1      > RETURN                                                       !0
   16     2*     > RETURN                                                       null

End of function getcurrentevent

End of class TestEvent.

Class TestStatus:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HTthL
function name:  __construct
number of ops:  7
compiled vars:  !0 = $eventId, !1 = $userId
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   23     2        ASSIGN_OBJ                                                   'eventId'
          3        OP_DATA                                                      !0
   24     4        ASSIGN_OBJ                                                   'userId'
          5        OP_DATA                                                      !1
   25     6      > RETURN                                                       null

End of function __construct

Function process:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HTthL
function name:  process
number of ops:  12
compiled vars:  !0 = $userId, !1 = $eventId, !2 = $obj, !3 = $data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   27     0  E >   RECV                                                 !0      
   28     1        INIT_STATIC_METHOD_CALL                                      'TestEvent', 'getCurrentEvent'
          2        DO_FCALL                                          0  $4      
          3        ASSIGN                                                       !1, $4
   29     4        NEW                                                  $6      'TestStatus'
          5        SEND_VAR_EX                                                  !1
          6        SEND_VAR_EX                                                  !0
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !2, $6
   31     9        ASSIGN                                                       !3, <array>
   32    10      > RETURN                                                       !3
   33    11*     > RETURN                                                       null

End of function process

End of class TestStatus.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.14 ms | 1375 KiB | 15 Q