3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface b { public const PRIORITY_DEFAULT = 1024; public const PRIORITY_LOW = 2000; public function getPriority():int; } class a implements b { public function __construct() { echo self::PRIORITY_DEFAULT; } public function getPriority():int { return self::PRIORITY_LOW; } } $a = new a(); echo "\n".$a->getPriority();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n2Edm
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                            'a'
   17     1        NEW                                              $1      'a'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   18     4        INIT_METHOD_CALL                                         !0, 'getPriority'
          5        DO_FCALL                                      0  $4      
          6        CONCAT                                           ~5      '%0A', $4
          7        ECHO                                                     ~5
          8      > RETURN                                                   1

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

End of function getpriority

End of class b.

Class a:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n2Edm
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_CLASS_CONSTANT                             ~0      'PRIORITY_DEFAULT'
          1        ECHO                                                     ~0
   14     2      > RETURN                                                   null

End of function __construct

Function getpriority:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n2Edm
function name:  getPriority
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_CLASS_CONSTANT                             ~0      'PRIORITY_LOW'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
          3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getpriority

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.92 ms | 1395 KiB | 13 Q