3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class TT { abstract public static function xd(); } class Test { public const OK = 0; public const IS_PUBLIC = 1 << 0; public const IS_ABSTRACT = 1 << 1; protected const ASD = 23; private static int $field = 5; public static function &getSomeProperty() { return self::$field; } } $a =& Test::getSomeProperty(); if ($a === 5) { $a = 2; } var_dump(Test::getSomeProperty()); // 2 $test = new Test(); var_dump(Test::OK); var_dump(Test::IS_PUBLIC);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/KHSHA
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   INIT_STATIC_METHOD_CALL                                      'Test', 'getSomeProperty'
          1        DO_FCALL                                          0  $2      
          2        ASSIGN_REF                                                   !0, $2
   27     3        IS_IDENTICAL                                                 !0, 5
          4      > JMPZ                                                         ~4, ->6
   28     5    >   ASSIGN                                                       !0, 2
   31     6    >   INIT_FCALL                                                   'var_dump'
          7        INIT_STATIC_METHOD_CALL                                      'Test', 'getSomeProperty'
          8        DO_FCALL                                          0  $6      
          9        SEND_VAR                                                     $6
         10        DO_ICALL                                                     
   33    11        NEW                                                  $8      'Test'
         12        DO_FCALL                                          0          
         13        ASSIGN                                                       !1, $8
   35    14        INIT_FCALL                                                   'var_dump'
         15        SEND_VAL                                                     0
         16        DO_ICALL                                                     
   36    17        INIT_FCALL                                                   'var_dump'
         18        SEND_VAL                                                     1
         19        DO_ICALL                                                     
         20      > RETURN                                                       1

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

End of function xd

End of class TT.

Class Test:
Function getsomeproperty:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/KHSHA
function name:  getSomeProperty
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   FETCH_STATIC_PROP_W              unknown             $0      'field'
          1      > RETURN_BY_REF                                                $0
   22     2*     > RETURN_BY_REF                                                null

End of function getsomeproperty

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.68 ms | 1397 KiB | 14 Q