3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $test; public function __construct($test = 1) { $this->test = $test; } protected function increaseTest() { $this->test++; } public function getTest() { return $this->test; } } class TestChild extends Test { public function increase() { $this->increaseTest(); } } $test = new TestChild(); echo $test->getTest() . "\n"; $test->increase(); echo $test->getTest() . "\n"; $test2 = new TestChild(5); echo $test2->getTest() . "\n"; $test2->increase(); echo $test2->getTest() . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c2K1q
function name:  (null)
number of ops:  28
compiled vars:  !0 = $test, !1 = $test2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $2      'TestChild'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   32     3        INIT_METHOD_CALL                                         !0, 'getTest'
          4        DO_FCALL                                      0  $5      
          5        CONCAT                                           ~6      $5, '%0A'
          6        ECHO                                                     ~6
   33     7        INIT_METHOD_CALL                                         !0, 'increase'
          8        DO_FCALL                                      0          
   34     9        INIT_METHOD_CALL                                         !0, 'getTest'
         10        DO_FCALL                                      0  $8      
         11        CONCAT                                           ~9      $8, '%0A'
         12        ECHO                                                     ~9
   36    13        NEW                                              $10     'TestChild'
         14        SEND_VAL_EX                                              5
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !1, $10
   37    17        INIT_METHOD_CALL                                         !1, 'getTest'
         18        DO_FCALL                                      0  $13     
         19        CONCAT                                           ~14     $13, '%0A'
         20        ECHO                                                     ~14
   38    21        INIT_METHOD_CALL                                         !1, 'increase'
         22        DO_FCALL                                      0          
   39    23        INIT_METHOD_CALL                                         !1, 'getTest'
         24        DO_FCALL                                      0  $16     
         25        CONCAT                                           ~17     $16, '%0A'
         26        ECHO                                                     ~17
         27      > RETURN                                                   1

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

End of function __construct

Function increasetest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c2K1q
function name:  increaseTest
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   PRE_INC_OBJ                                              'test'
   15     1      > RETURN                                                   null

End of function increasetest

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

End of function gettest

End of class Test.

Class TestChild:
Function increase:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c2K1q
function name:  increase
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_METHOD_CALL                                         'increaseTest'
          1        DO_FCALL                                      0          
   28     2      > RETURN                                                   null

End of function increase

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

End of function __construct

Function increasetest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c2K1q
function name:  increaseTest
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   PRE_INC_OBJ                                              'test'
   15     1      > RETURN                                                   null

End of function increasetest

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

End of function gettest

End of class TestChild.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.55 ms | 1399 KiB | 13 Q