3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait StaticTraitAccess { public static function cases() { return [ 'one' => 'won', 'two' => 'chwo', 'three' => 'tree', ]; } public static function thisIsWhatTheyreTalkingAbout() { return static::cases(); } } class StaticClassAccess { use StaticTraitAccess; public function staticCall1(): array { return static::thisIsWhatTheyreTalkingAbout(); } public function staticCall2(): array { return StaticClassAccess::thisIsWhatTheyreTalkingAbout(); } public function staticCall3(): array { return StaticTraitAccess::thisIsWhatTheyreTalkingAbout(); } } $sca = new StaticClassAccess(); var_dump($sca->staticCall1()); var_dump($sca->staticCall2()); var_dump($sca->staticCall3());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TfKvG
function name:  (null)
number of ops:  20
compiled vars:  !0 = $sca
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   DECLARE_CLASS                                            'staticclassaccess'
   39     1        NEW                                              $1      'StaticClassAccess'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   40     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'staticCall1'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   41     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !0, 'staticCall2'
         11        DO_FCALL                                      0  $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
   42    14        INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !0, 'staticCall3'
         16        DO_FCALL                                      0  $8      
         17        SEND_VAR                                                 $8
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class StaticTraitAccess:
Function cases:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TfKvG
function name:  cases
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   <array>
   12     1*     > RETURN                                                   null

End of function cases

Function thisiswhattheyretalkingabout:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TfKvG
function name:  thisIsWhatTheyreTalkingAbout
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_STATIC_METHOD_CALL                                  'cases'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   17     3*     > RETURN                                                   null

End of function thisiswhattheyretalkingabout

End of class StaticTraitAccess.

Class StaticClassAccess:
Function staticcall1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TfKvG
function name:  staticCall1
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_STATIC_METHOD_CALL                                  'thisIsWhatTheyreTalkingAbout'
          1        DO_FCALL                                      0  $0      
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
   26     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function staticcall1

Function staticcall2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TfKvG
function name:  staticCall2
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   INIT_STATIC_METHOD_CALL                                  'StaticClassAccess', 'thisIsWhatTheyreTalkingAbout'
          1        DO_FCALL                                      0  $0      
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
   31     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function staticcall2

Function staticcall3:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TfKvG
function name:  staticCall3
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   INIT_STATIC_METHOD_CALL                                  'StaticTraitAccess', 'thisIsWhatTheyreTalkingAbout'
          1        DO_FCALL                                      0  $0      
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
   36     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function staticcall3

End of class StaticClassAccess.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.99 ms | 1015 KiB | 14 Q