3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class TT { abstract public static function xd(); } class Test { protected const ASD = 23; private static int $field = 5; public string $foo = 'default value' { get { var_dump(debug_backtrace()); return $this->foo; } set(string $value) { var_dump(debug_backtrace()); } } public static function &getSomeProperty() { return self::$field; } } $a =& Test::getSomeProperty(); if ($a === 5) { $a = 2; } var_dump(Test::getSomeProperty()); // 2 $test = new Test();
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/IA01u
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   30     0  E >   INIT_STATIC_METHOD_CALL                                      'Test', 'getSomeProperty'
          1        DO_FCALL                                          0  $2      
          2        ASSIGN_REF                                                   !0, $2
   32     3        IS_IDENTICAL                                                 !0, 5
          4      > JMPZ                                                         ~4, ->6
   33     5    >   ASSIGN                                                       !0, 2
   36     6    >   INIT_FCALL                                                   'var_dump'
          7        INIT_STATIC_METHOD_CALL                                      'Test', 'getSomeProperty'
          8        DO_FCALL                                          0  $6      
          9        SEND_VAR                                                     $6
         10        DO_ICALL                                                     
   38    11        NEW                                                  $8      'Test'
         12        DO_FCALL                                          0          
         13        ASSIGN                                                       !1, $8
         14      > RETURN                                                       1

Class TT:
Function xd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IA01u
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/IA01u
function name:  getSomeProperty
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   FETCH_STATIC_PROP_W              unknown             $0      'field'
          1      > RETURN_BY_REF                                                $0
   27     2*     > RETURN_BY_REF                                                null

End of function getsomeproperty

End of class Test.

Property foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IA01u
function name:  $foo::get
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_FCALL                                                   'debug_backtrace'
          2        DO_ICALL                                             $0      
          3        SEND_VAR                                                     $0
          4        DO_ICALL                                                     
   17     5        FETCH_OBJ_R                                          ~2      'foo'
          6        VERIFY_RETURN_TYPE                                           ~2
          7      > RETURN                                                       ~2
   18     8*       VERIFY_RETURN_TYPE                                           
          9*     > RETURN                                                       null

End of property foo:

Property foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IA01u
function name:  $foo::set
number of ops:  7
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   RECV                                                 !0      
   20     1        INIT_FCALL                                                   'var_dump'
          2        INIT_FCALL                                                   'debug_backtrace'
          3        DO_ICALL                                             $1      
          4        SEND_VAR                                                     $1
          5        DO_ICALL                                                     
   21     6      > RETURN                                                       null

End of property foo:

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
153.51 ms | 3402 KiB | 15 Q