3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { private $name; public function __construct($name) { $this->name = $name; } public function getName() { return $this->name; } public function getTitle() { return $this->getName()." the person"; } public function sayHello() { echo "Hello, I'm ".$this->getTitle()."<br/>"; } public function sayGoodbye() { echo "Goodbye from ".self::getTitle()."<br/>"; } } class Geek extends Person { public function __construct($name) { parent::__construct($name); } public function getTitle() { return $this->getName()." the geek"; } } $geekObj = new Geek("Ludwig"); $geekObj->sayHello(); $geekObj->sayGoodbye();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y6GhI
function name:  (null)
number of ops:  9
compiled vars:  !0 = $geekObj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   NEW                                              $1      'Geek'
          1        SEND_VAL_EX                                              'Ludwig'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   37     4        INIT_METHOD_CALL                                         !0, 'sayHello'
          5        DO_FCALL                                      0          
   38     6        INIT_METHOD_CALL                                         !0, 'sayGoodbye'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class Person:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y6GhI
function name:  __construct
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'name'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y6GhI
function name:  getName
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1      > RETURN                                                   ~0
   11     2*     > RETURN                                                   null

End of function getname

Function gettitle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y6GhI
function name:  getTitle
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_METHOD_CALL                                         'getName'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      $0, '+the+person'
          3      > RETURN                                                   ~1
   15     4*     > RETURN                                                   null

End of function gettitle

Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y6GhI
function name:  sayHello
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_METHOD_CALL                                         'getTitle'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      'Hello%2C+I%27m+', $0
          3        CONCAT                                           ~2      ~1, '%3Cbr%2F%3E'
          4        ECHO                                                     ~2
   19     5      > RETURN                                                   null

End of function sayhello

Function saygoodbye:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y6GhI
function name:  sayGoodbye
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_STATIC_METHOD_CALL                                  'getTitle'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      'Goodbye+from+', $0
          3        CONCAT                                           ~2      ~1, '%3Cbr%2F%3E'
          4        ECHO                                                     ~2
   23     5      > RETURN                                                   null

End of function saygoodbye

End of class Person.

Class Geek:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y6GhI
function name:  __construct
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   28     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   29     4      > RETURN                                                   null

End of function __construct

Function gettitle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y6GhI
function name:  getTitle
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   INIT_METHOD_CALL                                         'getName'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      $0, '+the+geek'
          3      > RETURN                                                   ~1
   33     4*     > RETURN                                                   null

End of function gettitle

Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y6GhI
function name:  getName
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1      > RETURN                                                   ~0
   11     2*     > RETURN                                                   null

End of function getname

Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y6GhI
function name:  sayHello
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_METHOD_CALL                                         'getTitle'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      'Hello%2C+I%27m+', $0
          3        CONCAT                                           ~2      ~1, '%3Cbr%2F%3E'
          4        ECHO                                                     ~2
   19     5      > RETURN                                                   null

End of function sayhello

Function saygoodbye:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y6GhI
function name:  sayGoodbye
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_STATIC_METHOD_CALL                                  'getTitle'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      'Goodbye+from+', $0
          3        CONCAT                                           ~2      ~1, '%3Cbr%2F%3E'
          4        ECHO                                                     ~2
   23     5      > RETURN                                                   null

End of function saygoodbye

End of class Geek.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.88 ms | 1394 KiB | 13 Q