3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $answerText = "52"; public function getAnswerText() { return $this->answerText; } } $data = array(); $test = new Test(); $data[5] = 12; $data[52] = 0; $data[(int) $test->getAnswerText()]++; var_dump($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8ATBU
function name:  (null)
number of ops:  17
compiled vars:  !0 = $data, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   14     1        NEW                                              $3      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   16     4        ASSIGN_DIM                                               !0, 5
          5        OP_DATA                                                  12
   17     6        ASSIGN_DIM                                               !0, 52
          7        OP_DATA                                                  0
   19     8        INIT_METHOD_CALL                                         !1, 'getAnswerText'
          9        DO_FCALL                                      0  $8      
         10        CAST                                          4  ~9      $8
         11        FETCH_DIM_RW                                     $10     !0, ~9
         12        PRE_INC                                                  $10
   21    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class Test:
Function getanswertext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8ATBU
function name:  getAnswerText
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~0      'answerText'
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function getanswertext

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.41 ms | 1395 KiB | 15 Q