3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class A { static function call() { return static::test(5); } abstract static function test(int $x): int; } class B extends A { static function test(int $x): int { return $x * 2; } } echo B::call();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pid7W
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                      'B', 'call'
          1        DO_FCALL                                          0  $0      
          2        ECHO                                                         $0
          3      > RETURN                                                       1

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

End of function call

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pid7W
function name:  test
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
          1        VERIFY_RETURN_TYPE                                           
          2      > RETURN                                                       null

End of function test

End of class A.

Class B:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pid7W
function name:  test
number of ops:  6
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
   13     1        MUL                                                  ~1      !0, 2
          2        VERIFY_RETURN_TYPE                                           ~1
          3      > RETURN                                                       ~1
   14     4*       VERIFY_RETURN_TYPE                                           
          5*     > RETURN                                                       null

End of function test

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

End of function call

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
153.93 ms | 1580 KiB | 13 Q