3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Dad { protected $name; protected $surname; public function __consruct(string $name, string $surname) { $this->name = $name; $this->surname = $surname; } public function run() { echo 'I run fast'; } protected function drive() { echo 'I drive a car'; } } class Son extends Dad { public function goToSchool() { echo 'I go to school'; } public function whatIsMyName() { echo $this->name; } } $son = new Son('Nick', 'Long'); $son->drive(); //produce an error
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LBYTg
function name:  (null)
number of ops:  8
compiled vars:  !0 = $son
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   NEW                                              $1      'Son'
          1        SEND_VAL_EX                                              'Nick'
          2        SEND_VAL_EX                                              'Long'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   39     5        INIT_METHOD_CALL                                         !0, 'drive'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

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

End of function __consruct

Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LBYTg
function name:  run
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'I+run+fast'
   17     1      > RETURN                                                   null

End of function run

Function drive:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LBYTg
function name:  drive
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     'I+drive+a+car'
   22     1      > RETURN                                                   null

End of function drive

End of class Dad.

Class Son:
Function gotoschool:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LBYTg
function name:  goToSchool
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   ECHO                                                     'I+go+to+school'
   30     1      > RETURN                                                   null

End of function gotoschool

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

End of function whatismyname

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

End of function __consruct

Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LBYTg
function name:  run
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'I+run+fast'
   17     1      > RETURN                                                   null

End of function run

Function drive:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LBYTg
function name:  drive
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     'I+drive+a+car'
   22     1      > RETURN                                                   null

End of function drive

End of class Son.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.13 ms | 1399 KiB | 13 Q