3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private static $test; public static function hasTest() { return !!static::$test; } public static function setTest($test) { static::$test = $test; } } class FooExtension extends Foo { } class_alias('FooExtension', 'FooAlias'); FooExtension::setTest('derp'); var_dump(FooAlias::hasTest());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aIFlG
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'class_alias'
          1        SEND_VAL                                                 'FooExtension'
          2        SEND_VAL                                                 'FooAlias'
          3        DO_ICALL                                                 
   27     4        INIT_STATIC_METHOD_CALL                                  'FooExtension', 'setTest'
          5        SEND_VAL                                                 'derp'
          6        DO_FCALL                                      0          
   28     7        INIT_FCALL                                               'var_dump'
          8        INIT_STATIC_METHOD_CALL                                  'FooAlias', 'hasTest'
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Class Foo:
Function hastest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aIFlG
function name:  hasTest
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'test'
          1        BOOL_NOT                                         ~1      ~0
          2        BOOL_NOT                                         ~2      ~1
          3      > RETURN                                                   ~2
   11     4*     > RETURN                                                   null

End of function hastest

Function settest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aIFlG
function name:  setTest
number of ops:  4
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        ASSIGN_STATIC_PROP                                       'test'
          2        OP_DATA                                                  !0
   16     3      > RETURN                                                   null

End of function settest

End of class Foo.

Class FooExtension:
Function hastest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aIFlG
function name:  hasTest
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'test'
          1        BOOL_NOT                                         ~1      ~0
          2        BOOL_NOT                                         ~2      ~1
          3      > RETURN                                                   ~2
   11     4*     > RETURN                                                   null

End of function hastest

Function settest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aIFlG
function name:  setTest
number of ops:  4
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        ASSIGN_STATIC_PROP                                       'test'
          2        OP_DATA                                                  !0
   16     3      > RETURN                                                   null

End of function settest

End of class FooExtension.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.8 ms | 1400 KiB | 17 Q