3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static $a; public $b; public function ab() { return $this::$b; } public function __construct() { var_dump($this::ab(), $this::ab()); } } $a = new A; $a::ab();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4onpT
function name:  (null)
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        FETCH_CLASS                                   0  $4      !0
          4        INIT_STATIC_METHOD_CALL                                  $4, 'ab'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class A:
Function ab:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4onpT
function name:  ab
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_THIS                                       ~0      
          1        FETCH_CLASS                                   0  $1      ~0
          2        FETCH_STATIC_PROP_R          unknown             ~2      'b'
          3      > RETURN                                                   ~2
    8     4*     > RETURN                                                   null

End of function ab

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4onpT
function name:  __construct
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        FETCH_CLASS                                   0  $1      ~0
          3        INIT_STATIC_METHOD_CALL                                  $1, 'ab'
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        FETCH_THIS                                       ~3      
          7        FETCH_CLASS                                   0  $4      ~3
          8        INIT_STATIC_METHOD_CALL                                  $4, 'ab'
          9        DO_FCALL                                      0  $5      
         10        SEND_VAR                                                 $5
         11        DO_ICALL                                                 
   11    12      > RETURN                                                   null

End of function __construct

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.38 ms | 1388 KiB | 15 Q