3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Dog { public static function bark() { return 'Woof!'; } } echo Dog::bark()."\n"; // method is static, so this is ok class Cat { public function purr() // NOT static { return 'purrrrrrrrr'; } } echo Cat::purr()."\n"; // will generate deprecation warning $cat = new Cat(); echo $cat->purr()."\n"; // will work fine
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9hdXB
function name:  (null)
number of ops:  16
compiled vars:  !0 = $cat
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_STATIC_METHOD_CALL                                  'Dog', 'bark'
          1        DO_FCALL                                      0  $1      
          2        CONCAT                                           ~2      $1, '%0A'
          3        ECHO                                                     ~2
   21     4        INIT_STATIC_METHOD_CALL                                  'Cat', 'purr'
          5        DO_FCALL                                      0  $3      
          6        CONCAT                                           ~4      $3, '%0A'
          7        ECHO                                                     ~4
   23     8        NEW                                              $5      'Cat'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !0, $5
   24    11        INIT_METHOD_CALL                                         !0, 'purr'
         12        DO_FCALL                                      0  $8      
         13        CONCAT                                           ~9      $8, '%0A'
         14        ECHO                                                     ~9
         15      > RETURN                                                   1

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

End of function bark

End of class Dog.

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

End of function purr

End of class Cat.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
226.86 ms | 1394 KiB | 13 Q