3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Db { public static function getInstance() { return "Hi, I'm a test"; } } class Entity { } class Player extends Entity { public function setPlayer() { return Db::getInstance(); } } $x = new Player(); echo $x->setPlayer();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XrBC3
function name:  (null)
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'Player'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        INIT_METHOD_CALL                                         !0, 'setPlayer'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

Class Db:
Function getinstance:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XrBC3
function name:  getInstance
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   'Hi%2C+I%27m+a+test'
    8     1*     > RETURN                                                   null

End of function getinstance

End of class Db.

Class Entity: [no user functions]
Class Player:
Function setplayer:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XrBC3
function name:  setPlayer
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_STATIC_METHOD_CALL                                  'Db', 'getInstance'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   22     3*     > RETURN                                                   null

End of function setplayer

End of class Player.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.13 ms | 998 KiB | 13 Q