3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* final */class Animal { public static $version = 'ANI01'; public function move(int $steps): void { echo "$steps déplacements"; } public static function version(): string { // return static::$version; return self::$version; } } class Cat extends Animal { public static $version = 'CAT07'; public function move(int $steps): void { // parent::move($steps); echo "$steps pas"; } } $animal = new Animal(); $cat = new Cat(); $cat->move(2); echo PHP_EOL; echo Cat::version().PHP_EOL; var_dump($cat instanceof Animal); var_dump(Cat::class);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SAmgD
function name:  (null)
number of ops:  22
compiled vars:  !0 = $animal, !1 = $cat
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $2      'Animal'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   31     3        NEW                                              $5      'Cat'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   33     6        INIT_METHOD_CALL                                         !1, 'move'
          7        SEND_VAL_EX                                              2
          8        DO_FCALL                                      0          
   34     9        ECHO                                                     '%0A'
   35    10        INIT_STATIC_METHOD_CALL                                  'Cat', 'version'
         11        DO_FCALL                                      0  $9      
         12        CONCAT                                           ~10     $9, '%0A'
         13        ECHO                                                     ~10
   37    14        INIT_FCALL                                               'var_dump'
         15        INSTANCEOF                                       ~11     !1, 'Animal'
         16        SEND_VAL                                                 ~11
         17        DO_ICALL                                                 
   38    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAL                                                 'Cat'
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class Animal:
Function move:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SAmgD
function name:  move
number of ops:  5
compiled vars:  !0 = $steps
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        NOP                                                      
          2        FAST_CONCAT                                      ~1      !0, '+d%C3%A9placements'
          3        ECHO                                                     ~1
   10     4      > RETURN                                                   null

End of function move

Function version:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SAmgD
function name:  version
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'version'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   16     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function version

End of class Animal.

Class Cat:
Function move:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SAmgD
function name:  move
number of ops:  5
compiled vars:  !0 = $steps
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   26     1        NOP                                                      
          2        FAST_CONCAT                                      ~1      !0, '+pas'
          3        ECHO                                                     ~1
   27     4      > RETURN                                                   null

End of function move

Function version:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SAmgD
function name:  version
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'version'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   16     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function version

End of class Cat.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.06 ms | 1400 KiB | 15 Q