3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private const ASD = 'asd'; public function handle() { return self::ASD . PHP_EOL; } } class B extends A {} $a = new A; $b = new B; echo $a->handle(); echo $b->handle(); class AA { private const ASD = 'asd'; public function handle() { return static::ASD . PHP_EOL; } } class BB extends AA {} $a = new AA; $b = new BB; echo $a->handle(); echo $b->handle();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l0c8r
function name:  (null)
number of ops:  25
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   16     3        NEW                                              $5      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   18     6        INIT_METHOD_CALL                                         !0, 'handle'
          7        DO_FCALL                                      0  $8      
          8        ECHO                                                     $8
   19     9        INIT_METHOD_CALL                                         !1, 'handle'
         10        DO_FCALL                                      0  $9      
         11        ECHO                                                     $9
   33    12        NEW                                              $10     'AA'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !0, $10
   34    15        NEW                                              $13     'BB'
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !1, $13
   36    18        INIT_METHOD_CALL                                         !0, 'handle'
         19        DO_FCALL                                      0  $16     
         20        ECHO                                                     $16
   37    21        INIT_METHOD_CALL                                         !1, 'handle'
         22        DO_FCALL                                      0  $17     
         23        ECHO                                                     $17
         24      > RETURN                                                   1

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

End of function handle

End of class A.

Class B:
Function handle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l0c8r
function name:  handle
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   'asd%0A'
    9     1*     > RETURN                                                   null

End of function handle

End of class B.

Class AA:
Function handle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l0c8r
function name:  handle
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   FETCH_CLASS_CONSTANT                             ~0      'ASD'
          1        CONCAT                                           ~1      ~0, '%0A'
          2      > RETURN                                                   ~1
   27     3*     > RETURN                                                   null

End of function handle

End of class AA.

Class BB:
Function handle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l0c8r
function name:  handle
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   FETCH_CLASS_CONSTANT                             ~0      'ASD'
          1        CONCAT                                           ~1      ~0, '%0A'
          2      > RETURN                                                   ~1
   27     3*     > RETURN                                                   null

End of function handle

End of class BB.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.1 ms | 1399 KiB | 13 Q